Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b079fb9877 | ||
|
608fba03ab | ||
|
a626c346b4 | ||
|
1955914e73 | ||
|
a3e117be2c | ||
|
459e7b77ab | ||
|
2fc4884b88 | ||
|
1f02c1903a | ||
|
6ecfaf3ab6 | ||
|
89ecea11d2 | ||
|
c4e1d8c918 | ||
|
b776f4ee07 | ||
|
90e61140aa | ||
|
19a49b8e74 | ||
|
fd29020f87 | ||
|
c4ca00a26f | ||
|
507ead3c5a | ||
|
77003e1894 | ||
|
4931fcd8a9 | ||
|
1c96596ae7 | ||
|
bb368e271e | ||
|
04ecb233f2 | ||
|
dbfb0666b2 | ||
|
c74b60ab81 | ||
|
3d41db2138 | ||
|
43764346a1 | ||
|
3c61e8f7e0 | ||
|
da9cb57f57 | ||
|
60490a5c19 | ||
|
2b5fcf89b2 | ||
|
99ee8eb9d3 | ||
|
b9a5469aa1 | ||
|
c004c09c9e | ||
|
f15afeb84b | ||
|
488b78ed3c | ||
|
6faa1bd160 | ||
|
00be1552ed | ||
|
a2bacd54f4 | ||
|
d2abb6d844 | ||
|
e697b85307 | ||
|
9967602647 | ||
|
e1a92d9ef0 | ||
|
730b9ecc2d | ||
|
336e2cdeda | ||
|
e5021ff47f | ||
|
9735948819 | ||
|
660a8938a3 | ||
|
642ddd1253 | ||
|
03fc07c28b | ||
|
2e84f455db | ||
|
2d7f390051 | ||
|
80ffc5f84d | ||
|
d1069cad4b | ||
|
0c4931e873 | ||
|
3ea347e562 | ||
|
510d099d15 | ||
|
5bd54bef32 | ||
|
4f7ad5fb76 | ||
|
f706c128c2 | ||
|
209ae313a5 | ||
|
81f57d1135 | ||
|
9923f08703 |
@@ -661,8 +661,10 @@ endif()
|
||||
if (CAN_USE_GLES2)
|
||||
if (USE_GLES2)
|
||||
add_definitions (-DHAVE_GLES2_EXT)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
|
||||
if (NOT IOS)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
|
||||
endif()
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
|
||||
|
@@ -236,9 +236,11 @@ proc gendoc {args} {
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "s"} {
|
||||
if { [ lsearch $args_names "pdf" ] == -1 } {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: search is not used with PDF and will be ignored."
|
||||
continue
|
||||
}
|
||||
|
||||
if {$args_values(s) != "NULL"} {
|
||||
set SEARCH_MODE $args_values(s)
|
||||
} else {
|
||||
@@ -247,16 +249,16 @@ proc gendoc {args} {
|
||||
}
|
||||
} elseif {$arg_n == "mathjax"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set MATHJAX_LOCATION $args_values(mathjax)
|
||||
puts "$MATHJAX_LOCATION"
|
||||
} else {
|
||||
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $MATHJAX_LOCATION"
|
||||
}
|
||||
puts "Warning: MathJax is not used with PDF and will be ignored."
|
||||
}
|
||||
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set MATHJAX_LOCATION $args_values(mathjax)
|
||||
puts "$MATHJAX_LOCATION"
|
||||
} else {
|
||||
puts "Warning: MathJax is not used with pdf and will be ignored."
|
||||
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $MATHJAX_LOCATION"
|
||||
}
|
||||
} else {
|
||||
puts "\nWrong argument: $arg_n"
|
||||
|
@@ -12,7 +12,9 @@ samples/samples.md
|
||||
../samples/CSharp/ReadMe.md
|
||||
../samples/CSharp/ReadMe_D3D.md
|
||||
../samples/qt/AndroidQt/ReadMe.md
|
||||
../samples/qt/IESample/ReadMe.md
|
||||
../samples/qt/OCCTOverview/ReadMe.md
|
||||
../samples/qt/Tutorial/ReadMe.md
|
||||
../samples/java/jniviewer/ReadMe.md
|
||||
../samples/ios/UIKitSample/ReadMe.md
|
||||
../samples/webgl/ReadMe.md
|
||||
@@ -20,6 +22,7 @@ samples/ocaf.md
|
||||
samples/ocaf_func.md
|
||||
samples/draw_scripts.md
|
||||
|
||||
samples/novice_guide.md
|
||||
tutorial/tutorial.md
|
||||
|
||||
build/build_upgrade.md
|
||||
|
@@ -6,6 +6,8 @@
|
||||
|
||||
tutorial/tutorial.md
|
||||
|
||||
samples/novice_guide.md
|
||||
|
||||
upgrade/upgrade.md
|
||||
|
||||
user_guides/foundation_classes/foundation_classes.md
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Draw Demo Scripts {#samples__draw_scripts}
|
||||
Draw: Demo Scripts {#samples__draw_scripts}
|
||||
================
|
||||
|
||||
All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please
|
||||
|
BIN
dox/samples/images/sample_overview_qt_geometry.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
dox/samples/images/sample_overview_qt_ocaf.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
dox/samples/images/sample_overview_qt_topology.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
dox/samples/images/sample_overview_qt_triangulation.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
dox/samples/images/sample_overview_qt_viewers.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
dox/samples/images/sample_overview_qt_xde.png
Normal file
After Width: | Height: | Size: 28 KiB |
115
dox/samples/novice_guide.md
Normal file
@@ -0,0 +1,115 @@
|
||||
Novice Guide {#samples__novice_guide}
|
||||
=======
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section diffs Modeling with OCCT: Key differences
|
||||
|
||||
Open CASCADE Technology (OCCT) is an object-oriented C++ framework designed for rapid production of sophisticated CAD/CAM/CAE applications.
|
||||
In other words, it provides endless possibilities for raw 2D and 3D modeling in C++ environment.
|
||||
Unlike end-user software, it is used by the application developers and therefore strongly differs from the most popular CAD/CAM/CAE software packages.
|
||||
OCCT provides building blocks enough for modeling, editing, visualization, and data interoperability of 2D and 3D objects.
|
||||
|
||||
By using OCCT, users can create the objects of their desire (or edit already existing ones) using raw code commands.
|
||||
It is a more complicated process than using GUI-based software, but it provides much more flexibility than even script-based manipulations that are available within existing CAD/CAM/CAE applications.
|
||||
However, to fully grasp the possibilities of OCCT it is best for the user to have previous experience in C++ at least at a basic level.
|
||||
|
||||
@section basics Understanding the principles
|
||||
|
||||
If you don't have any programming skills, grasping the full magnitude of OCCT workflow is still an option.
|
||||
The documentation for OCCT contains several entry points for new users.
|
||||
It will not explain all OCCT classes but will help to comprehend the workflow and help start thinking in terms of Open CASCADE Technology.
|
||||
|
||||
The most basic workflow is described in the @ref occt__tutorial "OCCT Tutorial" - this is an excellent starting point for new users.
|
||||
In this tutorial you will create a solid model step-by-step using different classes and methods.
|
||||
Each step of the tutorial contains code snippets and images.
|
||||
|
||||
The basics involved in the modeling process are explained.
|
||||
When the basics of OCCT are clear, the next logical step is to check out @ref samples "sample applications" and examine those that suit your needs.
|
||||
For these, the best starting point is **OCCTOverview** located in /samples/qt subfolder of OCCT installation.
|
||||
|
||||
This sample provides code examples for several actions as well as visualization of these code snippets output.
|
||||
The Overview interface is dynamically changing based on selected **Category** at the menu.
|
||||
Additional menu buttons will appear, providing users with subcategories and relevant commands to select one of the actions.
|
||||
The result will appear in the viewer window, the code will appear at the top right, and in several cases the output will be produced at the bottom right window.
|
||||
|
||||
@figure{sample_overview_qt_viewers.png,"Comparison of 3D and 2D viewer windows",240} height=420px
|
||||
|
||||
The 3D viewer window has a row of preset interface buttons to customize the visual output.
|
||||
|
||||
Those buttons can be grouped into three types, left to right:
|
||||
|
||||
- View controls: **Fit all** and **Isometric**, will center the view and reset the camera angles respectively;
|
||||
- Display mode customization: **HLR,** e.g. "Hidden line removal" (works only when shading is disabled) can be turned on and off;
|
||||
solid models may be displayed either in **Shading** or **Wireframe** modes. **Transparency** level may be set for models in shading mode;
|
||||
- The last four buttons in a row are beautifiers enabling Ray-tracing engine and configuring it's parameters.
|
||||
|
||||
At the bottom left of the screen the orientation cube (trihedron) is located.
|
||||
The trihedron interactively shows the position of the camera in relation to the XYZ axis of the displayed data.
|
||||
The sides of the trihedron are labeled to help with orientation.
|
||||
Click on a side of the box to orient the camera view along the preferred axis.
|
||||
|
||||
The 2D viewer window lacks most of these elements and only have **Fit all** button.
|
||||
|
||||
The **Geometry** category of the Overview focuses on primitive objects like dots, lines (including vectors) or planes.
|
||||
These objects will appear in the viewer after the subcategory is selected.
|
||||
This section will demonstrate these entities both in 2D and 3D view mode and provide basic examples of parametric creation and data analysis.
|
||||
|
||||
@figure{sample_overview_qt_geometry.png,"",240} height=440px
|
||||
|
||||
The usage of the functions shown in the Overview is described more thoroughly at the @ref occt_user_guides__modeling_data "Modeling data" section of the documentation.
|
||||
Additionally, @ref occt_user_guides__modeling_algos "Modeling Algorithms" are used in more complex cases.
|
||||
|
||||
The **Topology** section of the Overview demonstrates the functions used in 3D operations.
|
||||
Multiple use cases are provided, including different object intersections, modifying and calculations.
|
||||
Some of these use cases are described in the documentation, such as @ref occt_user_guides__inspector "Inspector" usage.
|
||||
|
||||
@figure{sample_overview_qt_topology.png,"",240} height=440px
|
||||
|
||||
The subsections are grouped as shown on the screenshot before.
|
||||
Most shapes and primitive objects are introduced and then followed by a set of operations and interactions.
|
||||
|
||||
The **Triangulation** segment allows computing the number of triangles on a shape.
|
||||
|
||||
This may be inspected via [Poly_Triangulation Class Reference](https://dev.opencascade.org/doc/refman/html/class_poly___triangulation.html) -
|
||||
a part of the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html),
|
||||
an overall Open CASCADE code guide that may be used to inspect the key points in classes and their connections.
|
||||
|
||||
@figure{sample_overview_qt_triangulation.png,"",240} height=440px
|
||||
|
||||
The triangulation uses some of Mesh-related classes - see full description at @ref occt_user_guides__mesh "Mesh" documentation section.
|
||||
|
||||
The **Data exchange** section provides examples of how to export and import files of several different formats.
|
||||
|
||||
@figure{sample_overview_qt_xde.png,"",240} height=440px
|
||||
|
||||
The **OCAF** section gives an introduction for the @ref intro_overview_ocaf "Open CASCADE Application Framework" functionality.
|
||||
To test these functions, create an object first (box or cylinder).
|
||||
After that, the object may be modified and saved. Actions are recorded and may be undone or redone.
|
||||
|
||||
@figure{sample_overview_qt_ocaf.png,"",240} height=440px
|
||||
|
||||
**Viewers** section demonstrates examples of the 2D and 3D visualization outputs.
|
||||
Check @ref occt_user_guides__visualization "Visualization" section of the documentation for a detailed description.
|
||||
In addition to these two samples, there are much more that might be of use to a new user based on their particular use case.
|
||||
|
||||
Check Readme files in the sample directories to learn more about samples compilation.
|
||||
|
||||
**Note:** source code for OCCTOverview is stored at 'samples/qt/OCCTOverview/src' folder in your OCCT root,
|
||||
and the source code files for examples presented in subsections are stored at 'samples/OCCTOverview/code folder'.
|
||||
Several utility classes that are not presented in the example window may be found in example source code files.
|
||||
|
||||
The overall classes introduction may be found in the @ref occt_user_guides__foundation_classes "Foundation Classes" section of the documentation.
|
||||
The "Introduction" section contains short descriptions of the most massive entries in the documentation.
|
||||
|
||||
@section helps Additional assistance
|
||||
|
||||
There are several places that may be of use for new users.
|
||||
The first one is [Training & E-learning](https://dev.opencascade.org/resources/trainings) page that lists available trainings and describes their specifics.
|
||||
|
||||
The second one is the Overview documentation (this document is a part of it) - here you can find information that suits most of the use cases.
|
||||
This may seem overwhelming at first, but if you have the clear understanding of what do you seek, you will most likely find the required information.
|
||||
|
||||
Aside from the Overview documentation itself, the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html) is present.
|
||||
Use it to check classes descriptions, dependencies and examples.
|
||||
Additionally, there is a [Forum](https://dev.opencascade.org/forums) where you can contact the OCCT community and developers.
|
@@ -1,4 +1,4 @@
|
||||
OCAF Usage {#samples__ocaf}
|
||||
OCAF: Usage Tutorial {#samples__ocaf}
|
||||
========
|
||||
|
||||
## Getting Started
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Function Mechanism Usage {#samples__ocaf_func}
|
||||
OCAF: Function Mechanism {#samples__ocaf_func}
|
||||
========================
|
||||
|
||||
Let us describe the usage of the "Function Mechanism" of Open CASCADE Application Framework on a simple example.
|
||||
|
@@ -1,176 +1,56 @@
|
||||
Tutorials and Samples {#samples}
|
||||
=====================
|
||||
|
||||
Tutorial: Modelling a Bottle
|
||||
----------------------------
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but
|
||||
to help start thinking in terms of the Open CASCADE Technology.
|
||||
- @subpage samples__tutorials
|
||||
* @ref samples__novice_guide
|
||||
<br>A document providing an introductory information to newcomers.
|
||||
* @ref samples__draw_scripts
|
||||
<br>A set of demo scripts demonstrating OCCT functionality from DRAW.
|
||||
These scripts can be also considered as a tutorials on **Tcl** usage within @ref occt_user_guides__test_harness "Draw Harness".
|
||||
* @ref occt__tutorial
|
||||
<br>A programming tutorial teaching how to use OCCT services to model a 3D object.
|
||||
See also @ref samples_qt_tutorial
|
||||
* @ref samples__ocaf
|
||||
<br>A set of code snippets performing typical actions with @ref occt_user_guides__ocaf "OCAF" services for newcomers.
|
||||
* @ref samples__ocaf_func
|
||||
<br>A simple example dedicated to the usage of "Function Mechanism" of @ref occt_user_guides__ocaf "OCCT Application Framework".
|
||||
- @subpage samples__projects
|
||||
* @ref samples_qt_iesample
|
||||
<br>A cross-platform multi-document 3D Viewer sample with CAD import / export functionality based on **Qt Widgets** framework.
|
||||
* @ref samples_qml_android_occt
|
||||
<br>A cross-platform 3D Viewer sample with CAD import based on **QtQuick** framework.
|
||||
* @ref samples_qt_tutorial
|
||||
<br>A cross-platform sample application based on **Qt Widgets** framework and implementing @ref occt__tutorial.
|
||||
* @ref samples_qt_overview
|
||||
<br>A sample application interactively demonstrating OCCT C++ usage with code snippets for newcomers.
|
||||
* @ref samples_mfc_standard
|
||||
<br>A set of projects for Windows platform demonstrating OCCT usage based on **Microsoft Foundation Class** (**MFC**) library.
|
||||
* @ref samples_csharp_occt
|
||||
<br>A Multi-document 3D Viewer sample with CAD import / export functionality based on .NET and **Windows Forms** or **WPF**.
|
||||
* @ref samples_csharp_direct3d
|
||||
<br>3D Viewer sample wrapped into Direct3D context based on .NET and **Windows Presentation Foundation** (**WPF**).
|
||||
* @ref occt_samples_webgl
|
||||
<br>3D Viewer sample based on **Emscripten SDK** representing a static HTML page to be opened in Web Browser.
|
||||
* @ref samples_java_android_occt
|
||||
<br>3D Viewer sample with CAD import for Android mobile platform based on Android SDK and JNI layer.
|
||||
* @ref occt_samples_ios_uikit
|
||||
<br>3D Viewer sample for iOS platform based on Apple **UIKit** framework.
|
||||
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed
|
||||
to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
@page samples__tutorials Tutorials and Demos
|
||||
- @subpage samples__novice_guide
|
||||
- @subpage samples__draw_scripts
|
||||
- @subpage occt__tutorial
|
||||
- @subpage samples__ocaf
|
||||
- @subpage samples__ocaf_func
|
||||
|
||||
Read more about @subpage occt__tutorial
|
||||
|
||||
MFC
|
||||
---------
|
||||
|
||||
Visual C++ programming samples containing 10 Visual C++ projects
|
||||
illustrating how to use a particular module or functionality.
|
||||
|
||||
The list of MFC samples:
|
||||
|
||||
* Geometry
|
||||
* Modeling
|
||||
* Viewer2d
|
||||
* Viewer3d
|
||||
* ImportExport
|
||||
* Ocaf
|
||||
* Triangulation
|
||||
* HLR
|
||||
* Animation
|
||||
* Convert
|
||||
|
||||
@figure{/samples/images/samples_mvc.png}
|
||||
|
||||
**Remarks:**
|
||||
|
||||
* MFC samples are available only on Windows platform;
|
||||
* To start a sample use Open CASCADE Technology\\Samples\\Mfc\\ item of the Start\\Programs menu;
|
||||
* Read carefully readme.txt to learn about launching and compilation options.
|
||||
|
||||
See @subpage samples_mfc_standard "Readme" for details.
|
||||
|
||||
Qt
|
||||
---
|
||||
|
||||
OCCT includes several samples based on Qt application framework.
|
||||
These samples are available on all supported desktop platforms.
|
||||
|
||||
To start a sample on Windows use Open CASCADE Technology\\Samples\\Qt\\ item of the Start\\Programs menu.
|
||||
|
||||
Import Export
|
||||
-------------
|
||||
|
||||
Import Export programming sample contains 3D Viewer and Import / Export functionality.
|
||||
|
||||
@figure{/samples/images/samples_qt.png}
|
||||
|
||||
Tutorial
|
||||
---------
|
||||
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but
|
||||
to help start thinking in terms of the Open CASCADE Technology.
|
||||
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed
|
||||
to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
|
||||
**See also:** @ref occt__tutorial "OCCT Tutorial"
|
||||
|
||||
Overview
|
||||
---------
|
||||
|
||||
The Qt application providing samples for basic usage of C++ API of various OCCT functionality.
|
||||
|
||||
The samples are organized in several categories according to relevant module of OCCT:
|
||||
|
||||
* Geometry
|
||||
* Topology,
|
||||
* Triangulation
|
||||
* DataExchange
|
||||
* OCAF
|
||||
* Viewer 2d
|
||||
* Viewer 3d
|
||||
|
||||
Each sample presents geometry view, C++ code fragment and sample output window.
|
||||
|
||||
@figure{/samples/images/sample_overview_qt.png}
|
||||
|
||||
See \subpage samples_qt_overview "Readme" for details.
|
||||
|
||||
C#
|
||||
---
|
||||
|
||||
C# sample demonstrates integration of OCCT 3D Viewer and Import / Export functionality into .NET applications (using Windows Forms and WPF front ends).
|
||||
|
||||
@figure{/samples/images/samples_c__ie.png}
|
||||
|
||||
Import:
|
||||
|
||||
* BRep
|
||||
* Iges
|
||||
* Step
|
||||
|
||||
Export:
|
||||
|
||||
* Brep
|
||||
* Iges
|
||||
* Step
|
||||
* Stl
|
||||
* Vrml
|
||||
|
||||
See @subpage samples_csharp_occt "C# sample Readme" for details.
|
||||
|
||||
There is also another C# example with the same functionality, which demonstrates the integration of Direct3D Viewer into .NET applications using WPF front end.
|
||||
|
||||
See @subpage samples_csharp_direct3d "Direct3D C# sample Readme" for details.
|
||||
|
||||
Android
|
||||
---------
|
||||
|
||||
There are two samples are representing usage OCCT framework on Android mobile platform. They represent an OCCT-based 3D-viewer with CAD import support in formats BREP, STEP and IGES: jniviewer (java) and AndroidQt (qt+qml)
|
||||
|
||||
jniviewer
|
||||
@figure{/samples/images/samples_java_android_occt.jpg}
|
||||
Java -- See @subpage samples_java_android_occt "Android Java sample Readme" for details.
|
||||
|
||||
AndroidQt
|
||||
@figure{/samples/images/samples_qml_android_occt.jpg}
|
||||
Qt -- See \subpage samples_qml_android_occt "Android Qt sample Readme" for details.
|
||||
|
||||
iOS
|
||||
---
|
||||
|
||||
There is a sample demonstrating usage of OCCT on iOS with Apple UIKit framework.
|
||||
|
||||
@figure{/samples/images/sample_ios_uikit.png}
|
||||
|
||||
See @subpage occt_samples_ios_uikit "iOS sample Readme" for details.
|
||||
|
||||
Web
|
||||
---------
|
||||
|
||||
WebGL Viewer sample demonstrating usage of OCCT 3D Viewer in Web browser with Emscripten SDK can be found in `samples/webgl`.
|
||||
|
||||
@figure{/samples/images/sample_webgl.png}
|
||||
|
||||
See @subpage occt_samples_webgl "WebGL sample Readme" for details.
|
||||
|
||||
OCAF Usage Sample
|
||||
------------------
|
||||
|
||||
The provided set of samples dedicates to get initial knowledge about typical actions with OCAF services. It may be
|
||||
useful for newcomers.
|
||||
|
||||
Read more about @subpage samples__ocaf
|
||||
|
||||
OCAF Function Mechanism Usage
|
||||
-----------------------------
|
||||
|
||||
This simple example dedicates to the usage of "Function Mechanism" of OCCT Application Framework. It represents a "nail"
|
||||
composed by a cone and two cylinders of different radius and height.
|
||||
|
||||
Read more about @subpage samples__ocaf_func
|
||||
|
||||
Draw Demo Scripts
|
||||
------------------
|
||||
|
||||
A set of demo scripts demonsrates using OCCT functionality from DRAW. These scripts can be also considered as a
|
||||
tutorials on tcl usage within Draw.
|
||||
|
||||
Read more about @subpage samples__draw_scripts
|
||||
@page samples__projects Sample Projects
|
||||
- @subpage samples_qt_iesample
|
||||
- @subpage samples_qml_android_occt
|
||||
- @subpage samples_qt_tutorial
|
||||
- @subpage samples_qt_overview
|
||||
- @subpage samples_mfc_standard
|
||||
- @subpage samples_csharp_occt
|
||||
- @subpage samples_csharp_direct3d
|
||||
- @subpage occt_samples_webgl
|
||||
- @subpage samples_java_android_occt
|
||||
- @subpage occt_samples_ios_uikit
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Tutorial {#occt__tutorial}
|
||||
Modeling: Bottle Tutorial {#occt__tutorial}
|
||||
=======
|
||||
|
||||
@tableofcontents
|
||||
|
@@ -1,8 +1,9 @@
|
||||
OCCT CSharp sample {#samples_csharp_occt}
|
||||
.NET: Import/Export (C#|C++/CLI|WinForms|WPF) {#samples_csharp_occt}
|
||||
==================
|
||||
|
||||
This sample demonstrates how to use OCCT libraries in <b>.Net</b> application
|
||||
written using **CSharp** and **Windows Forms** or **Windows Presentation Foundation** (WPF).
|
||||
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
|
||||
|
||||
The connection between .Net and OCCT (C++) level is provided by proxy library
|
||||
**OCCProxy**, written in C++/CLI. The proxy library contains a single *ref* class
|
||||
@@ -14,6 +15,8 @@ Both applications provide the same functionality as the standard OCCT Import/Exp
|
||||
The first project is called *IE_WinForms* and uses Windows Forms for GUI.
|
||||
The second application is called *IE_WPF_WinForms* and uses Windows Presentation Foundation.
|
||||
|
||||
@figure{samples_c__ie.png}
|
||||
|
||||
Note a few important details:
|
||||
|
||||
- OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class;
|
||||
|
@@ -1,8 +1,9 @@
|
||||
Direct3D CSharp sample {#samples_csharp_direct3d}
|
||||
==================
|
||||
.NET: D3D/OpenGL Viewer (C#|C++/CLI|WPF) {#samples_csharp_direct3d}
|
||||
==================
|
||||
|
||||
This sample demonstrates how to use OCCT and DirectX libraries in <b>.Net</b> application
|
||||
written using **CSharp** and **Windows Presentation Foundation** (WPF).
|
||||
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
|
||||
|
||||
The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraries,
|
||||
**OCCProxy** and **D3DProxy**, written in C++/CLI. The proxy library **OCCProxy** contains a single
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
@@ -311,7 +311,7 @@ void OcafSamples::ModifyBoxOcafSample()
|
||||
Handle(TFunction_Function) aFunction;
|
||||
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
|
||||
{
|
||||
myResult << "Object cannot be modify.";
|
||||
myResult << "Object cannot be modified.";
|
||||
return;
|
||||
}
|
||||
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute
|
||||
@@ -413,7 +413,7 @@ void OcafSamples::ModifyCylinderOcafSample()
|
||||
Handle(TFunction_Function) aFunction;
|
||||
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
|
||||
{
|
||||
myResult << "Object cannot be modify.";
|
||||
myResult << "Object cannot be modified.";
|
||||
return;
|
||||
}
|
||||
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute
|
||||
|
@@ -1,12 +1,15 @@
|
||||
OCCT sample for iOS {#occt_samples_ios_uikit}
|
||||
iOS: 3D Viewer (Objective-C++|UIKit) {#occt_samples_ios_uikit}
|
||||
==================
|
||||
|
||||
UIKitSample consists of the Open CASCADE 3D Viewer which provides import of STEP files and toolbar with three buttons.
|
||||
The sample could be found within OCCT repository in folder `/samples/ios/UIKitSample/`.
|
||||
|
||||
The first and second buttons serve for import hardcoded STEP files. The third button displays "About" dialog.
|
||||
|
||||
The viewer supports zoom, pan and rotate actions. The viewer supports selection of solids as well.
|
||||
|
||||
@figure{sample_ios_uikit.png}
|
||||
|
||||
Installation and configuration:
|
||||
1. Make sure you are running Mac OS version 10.12.1 or above and properly installed XCode version 8.1 or above.
|
||||
2. Install Open CASCADE Technology (OCCT) and build static libraries for desired device or/and simulator on your workstation.
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
@@ -1,7 +1,8 @@
|
||||
OCCT JniViewer sample for Android {#samples_java_android_occt}
|
||||
Android: 3D Viewer (Java|C++|Android SDK|JNI) {#samples_java_android_occt}
|
||||
==================
|
||||
|
||||
This sample demonstrates simple way of using OCCT libraries in Android application written using Java.
|
||||
The sample could be found within OCCT repository in folder `/samples/java/jniviewer/`.
|
||||
|
||||
The connection between Java and OCCT (C++) level is provided by proxy library, libTKJniSample.so, written in C++ with exported JNI methods of Java class OcctJniRenderer.
|
||||
The proxy library contains single C++ class OcctJni_Viewer encapsulating OCCT viewer and providing functionality to manipulate this viewer
|
||||
@@ -13,6 +14,8 @@ and the code can be programmed on Java level similarly to C++ one.
|
||||
See description of OCCT Java Wrapper in Advanced Samples and Tools on OCCT web site at
|
||||
https://www.opencascade.com/content/advanced-samples-and-tools
|
||||
|
||||
@figure{samples_java_android_occt.jpg}
|
||||
|
||||
Install Android Studio 4.0+ and install building tools (check Tools -> SDK Manager):
|
||||
- Android SDK (API level 21 or higher).
|
||||
- Android SDK build tools.
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@@ -27,7 +27,7 @@ CSelectionDialog::CSelectionDialog (CHLRDoc* aDoc,CWnd* pParent /*=NULL*/)
|
||||
myDoc = aDoc;
|
||||
myIsDisplayed = false;
|
||||
//{{AFX_DATA_INIT(CSelectionDialog)
|
||||
m_Algo = 0;
|
||||
m_Algo = 1;
|
||||
m_DisplayMode = 0;
|
||||
m_NbIsos = 2;
|
||||
m_DrawHiddenLine = TRUE;
|
||||
|
@@ -1,6 +1,21 @@
|
||||
MFC samples {#samples_mfc_standard}
|
||||
MFC: OCCT Samples (C++|MFC) {#samples_mfc_standard}
|
||||
==========
|
||||
|
||||
Visual C++ programming samples for Windows platform containing illustrating how to use a particular module or functionality, including the following MFC samples:
|
||||
|
||||
* Geometry
|
||||
* Modeling
|
||||
* Viewer2d
|
||||
* Viewer3d
|
||||
* ImportExport
|
||||
* Ocaf
|
||||
* Triangulation
|
||||
* HLR
|
||||
* Animation
|
||||
* Convert
|
||||
|
||||
@figure{samples_mvc.png}
|
||||
|
||||
1. Contents
|
||||
-----------------------
|
||||
|
||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@@ -1,12 +1,15 @@
|
||||
OCCT AndroidQt sample for Android {#samples_qml_android_occt}
|
||||
Qt: 3D Viewer (C++|QtQuick|QML) {#samples_qml_android_occt}
|
||||
==================
|
||||
|
||||
This sample demonstrates a simple way of using OCCT libraries in Android application written using Qt/Qml.
|
||||
The sample could be found within OCCT repository in folder `/samples/qt/AndroidQt/`.
|
||||
|
||||
The connection between Qt/Qml and OCCT (C++) level is provided by proxy library, libAndroidQt.so, written in C++.
|
||||
The proxy library contains single C++ class AndroidQt encapsulating OCCT viewer and providing functionality to manipulate this viewer
|
||||
and to import OCCT shapes from supported format of CAD file (BREP).
|
||||
|
||||
@figure{samples_qml_android_occt.jpg}
|
||||
|
||||
Requirements for building sample:
|
||||
* Java Development Kit 1.7 or higher
|
||||
* Qt 5.3 or higher
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
10
samples/qt/IESample/ReadMe.md
Normal file
@@ -0,0 +1,10 @@
|
||||
Qt: Import/Export (C++|Qt Widgets) {#samples_qt_iesample}
|
||||
==========
|
||||
|
||||
OCCT includes several samples based on Qt application framework.
|
||||
These samples are available on all supported desktop platforms.
|
||||
|
||||
This Import Export programming sample contains 3D Viewer and Import / Export functionality.
|
||||
The sample could be found within OCCT repository in folder `/samples/qt/IESample/`.
|
||||
|
||||
@figure{samples_qt.png}
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
@@ -1,6 +1,22 @@
|
||||
Qt OCCT Overview samples {#samples_qt_overview}
|
||||
Qt: OCCT Overview (C++|Qt Widgets) {#samples_qt_overview}
|
||||
==========
|
||||
|
||||
The Overview Qt application provides code snippets for basic usage of C++ API of various OCCT functionality.
|
||||
The samples are organized in several categories according to relevant module of OCCT:
|
||||
|
||||
* Geometry
|
||||
* Topology
|
||||
* Triangulation
|
||||
* DataExchange
|
||||
* OCAF
|
||||
* Viewer 2d
|
||||
* Viewer 3d
|
||||
|
||||
Each sample presents geometry view, C++ code fragment and sample output window.
|
||||
This sample is described in the @ref samples__novice_guide "Novice guide" for new users.
|
||||
|
||||
@figure{sample_overview_qt.png}
|
||||
|
||||
1. Contents
|
||||
-----------------------
|
||||
|
||||
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
11
samples/qt/Tutorial/ReadMe.md
Normal file
@@ -0,0 +1,11 @@
|
||||
Qt: Bottle Tutorial (C++|Qt Widgets) {#samples_qt_tutorial}
|
||||
==========
|
||||
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but to help start thinking in terms of the Open CASCADE Technology.
|
||||
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
|
||||
**See also:** @ref occt__tutorial "OCCT Tutorial"
|
@@ -1,4 +1,4 @@
|
||||
OCCT WebGL Viewer sample {#occt_samples_webgl}
|
||||
WebGL: 3D Viewer (JavaScript|C++|WebAssembly) {#occt_samples_webgl}
|
||||
==================
|
||||
|
||||
This sample demonstrates simple way of using OCCT libraries in Web application written in C++ and translated into WebAssembly module using Emscripten SDK (emsdk):
|
||||
@@ -6,6 +6,9 @@ https://emscripten.org/
|
||||
|
||||
Sample consists of the Open CASCADE 3D Viewer with a button for opening a model in BREP format.
|
||||
The sample requires a WebGL 2.0 capable browser supporting WebAssembly 1.0 (Wasm).
|
||||
The sample could be found within OCCT repository in folder `/samples/webgl/`.
|
||||
|
||||
@figure{sample_webgl.png,"",240} height=408px
|
||||
|
||||
Installation and configuration:
|
||||
1. Install Emscripten SDK and activate minimal configuration (Python, Java and CLang) following *emsdk* documentation. Activate also MinGW when building sample on Windows host.
|
||||
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
@@ -17,8 +17,8 @@
|
||||
| de l'approximation a deux variables
|
||||
| a utiliser dans AdvApp2Var
|
||||
|--------------------------------------------------------------*/
|
||||
#ifndef ApproxF2var_HeaderFile
|
||||
#define ApproxF2var_HeaderFile
|
||||
#ifndef AdvApp2Var_ApproxF2var_HeaderFile
|
||||
#define AdvApp2Var_ApproxF2var_HeaderFile
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AdvApp2Var_Data_f2c.hxx>
|
||||
|
@@ -12,8 +12,8 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// AdvApp2Var_Data_f2c.hxx
|
||||
#ifndef Data_f2c_HeaderFile
|
||||
#define Data_f2c_HeaderFile
|
||||
#ifndef AdvApp2Var_Data_f2c_HeaderFile
|
||||
#define AdvApp2Var_Data_f2c_HeaderFile
|
||||
|
||||
#ifndef F2CTYPE_DEFINED
|
||||
typedef int integer;
|
||||
|
@@ -12,8 +12,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef math_ContMatrices_HeaderFile
|
||||
#define math_ContMatrices_HeaderFile
|
||||
#ifndef AppCont_ContMatrices_HeaderFile
|
||||
#define AppCont_ContMatrices_HeaderFile
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
|
@@ -173,8 +173,17 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
|
||||
{
|
||||
Standard_Real t = IntToReal(i) / IntToReal(nbp);
|
||||
Standard_Real u = first * (1.0 - t) + last * t;
|
||||
gp_Pnt Pc3d = c3d->Value(u);
|
||||
gp_Pnt Pcons = cons.Value(u);
|
||||
gp_Pnt Pc3d, Pcons;
|
||||
try
|
||||
{
|
||||
Pc3d = c3d->Value(u);
|
||||
Pcons = cons.Value(u);
|
||||
}
|
||||
catch (Standard_Failure const&)
|
||||
{
|
||||
d2 = Precision::Infinite();
|
||||
break;
|
||||
}
|
||||
if (Precision::IsInfinite(Pcons.X()) ||
|
||||
Precision::IsInfinite(Pcons.Y()) ||
|
||||
Precision::IsInfinite(Pcons.Z()))
|
||||
|
@@ -91,7 +91,7 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline,
|
||||
//function : Parameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static void Parameters(const ApproxInt_TheMultiLine& Line,
|
||||
void ApproxInt_Approx::Parameters(const ApproxInt_TheMultiLine& Line,
|
||||
const Standard_Integer firstP,
|
||||
const Standard_Integer lastP,
|
||||
const Approx_ParametrizationType Par,
|
||||
|
@@ -26,6 +26,8 @@
|
||||
#include <Precision.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <GeomInt_WLApprox.hxx>
|
||||
#include <GeomInt_TheMultiLineOfWLApprox.hxx>
|
||||
|
||||
// (Sqrt(5.0) - 1.0) / 4.0
|
||||
//static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282;
|
||||
@@ -88,6 +90,94 @@ static Standard_Real EvalCurv(const Standard_Real dim,
|
||||
return curv;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BuildCurvature
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ApproxInt_KnotTools::BuildCurvature(
|
||||
const NCollection_LocalArray<Standard_Real>& theCoords,
|
||||
const Standard_Integer theDim,
|
||||
const math_Vector& thePars,
|
||||
TColStd_Array1OfReal& theCurv,
|
||||
Standard_Real& theMaxCurv)
|
||||
{
|
||||
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
|
||||
Standard_Real Val[21], Par[3], Res[21];
|
||||
Standard_Integer i, j, m, ic;
|
||||
Standard_Integer dim = theDim;
|
||||
//
|
||||
theMaxCurv = 0.;
|
||||
if (theCurv.Length() < 3)
|
||||
{
|
||||
theCurv.Init(0.);
|
||||
return;
|
||||
}
|
||||
i = theCurv.Lower();
|
||||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i + j;
|
||||
ic = (k - theCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for (m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[0], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
|
||||
//
|
||||
if (theCurv(i) > theMaxCurv)
|
||||
{
|
||||
theMaxCurv = theCurv(i);
|
||||
}
|
||||
//
|
||||
for (i = theCurv.Lower() + 1; i < theCurv.Upper(); ++i)
|
||||
{
|
||||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i + j - 1;
|
||||
ic = (k - theCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for (m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[1], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
|
||||
if (theCurv(i) > theMaxCurv)
|
||||
{
|
||||
theMaxCurv = theCurv(i);
|
||||
}
|
||||
}
|
||||
//
|
||||
i = theCurv.Upper();
|
||||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i + j - 2;
|
||||
ic = (k - theCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for (m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[2], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
theCurv(i) = EvalCurv(dim, &Res[dim], &Res[2 * dim]);
|
||||
if (theCurv(i) > theMaxCurv)
|
||||
{
|
||||
theMaxCurv = theCurv(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeKnotInds
|
||||
//purpose :
|
||||
@@ -100,75 +190,10 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
|
||||
//I: Create discrete curvature.
|
||||
NCollection_Sequence<Standard_Integer> aFeatureInds;
|
||||
TColStd_Array1OfReal aCurv(thePars.Lower(), thePars.Upper());
|
||||
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
|
||||
Standard_Real Val[21], Par[3], Res[21];
|
||||
Standard_Integer i, j, m, ic;
|
||||
Standard_Real aMaxCurv = 0.;
|
||||
Standard_Integer dim = theDim;
|
||||
//
|
||||
i = aCurv.Lower();
|
||||
for(j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i+j;
|
||||
ic = (k - aCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for(m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[0], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
|
||||
//
|
||||
if(aCurv(i) > aMaxCurv)
|
||||
{
|
||||
aMaxCurv = aCurv(i);
|
||||
}
|
||||
//
|
||||
for(i = aCurv.Lower()+1; i < aCurv.Upper(); ++i)
|
||||
{
|
||||
for(j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i+j-1;
|
||||
ic = (k - aCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for(m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[1], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
|
||||
if(aCurv(i) > aMaxCurv)
|
||||
{
|
||||
aMaxCurv = aCurv(i);
|
||||
}
|
||||
}
|
||||
//
|
||||
i = aCurv.Upper();
|
||||
for(j = 0; j < 3; ++j)
|
||||
{
|
||||
Standard_Integer k = i+j-2;
|
||||
ic = (k - aCurv.Lower()) * dim;
|
||||
Standard_Integer l = dim*j;
|
||||
for(m = 0; m < dim; ++m)
|
||||
{
|
||||
Val[l + m] = theCoords[ic + m];
|
||||
}
|
||||
Par[j] = thePars(k);
|
||||
}
|
||||
PLib::EvalLagrange(Par[2], 2, 2, dim, *Val, *Par, *Res);
|
||||
//
|
||||
aCurv(i) = EvalCurv(dim, &Res[dim], &Res[2*dim]);
|
||||
if(aCurv(i) > aMaxCurv)
|
||||
{
|
||||
aMaxCurv = aCurv(i);
|
||||
}
|
||||
|
||||
BuildCurvature(theCoords, theDim, thePars, aCurv, aMaxCurv);
|
||||
//
|
||||
Standard_Integer i, j, dim = theDim;
|
||||
#ifdef APPROXINT_KNOTTOOLS_DEBUG
|
||||
std::cout << "Discrete curvature array is" << std::endl;
|
||||
for(i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
|
||||
@@ -627,3 +652,172 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
|
||||
#endif
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MaxParamRatio
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Real MaxParamRatio(const math_Vector& thePars)
|
||||
{
|
||||
Standard_Integer i;
|
||||
Standard_Real aMaxRatio = 0.;
|
||||
//
|
||||
for (i = thePars.Lower() + 1; i < thePars.Upper(); ++i)
|
||||
{
|
||||
Standard_Real aRat = (thePars(i + 1) - thePars(i)) / (thePars(i) - thePars(i - 1));
|
||||
if (aRat < 1.)
|
||||
aRat = 1. / aRat;
|
||||
|
||||
aMaxRatio = Max(aMaxRatio, aRat);
|
||||
}
|
||||
return aMaxRatio;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : DefineParType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Approx_ParametrizationType ApproxInt_KnotTools::DefineParType(
|
||||
const Handle(IntPatch_WLine)& theWL,
|
||||
const Standard_Integer theFpar, const Standard_Integer theLpar,
|
||||
const Standard_Boolean theApproxXYZ,
|
||||
const Standard_Boolean theApproxU1V1,
|
||||
const Standard_Boolean theApproxU2V2
|
||||
)
|
||||
{
|
||||
if (theLpar - theFpar == 1)
|
||||
return Approx_IsoParametric;
|
||||
|
||||
const Standard_Integer nbp3d = theApproxXYZ ? 1 : 0,
|
||||
nbp2d = (theApproxU1V1 ? 1 : 0) + (theApproxU2V2 ? 1 : 0);
|
||||
|
||||
GeomInt_TheMultiLineOfWLApprox aTestLine(theWL, nbp3d, nbp2d, theApproxU1V1, theApproxU2V2,
|
||||
0., 0., 0., 0., 0., 0., 0., theApproxU1V1, theFpar, theLpar);
|
||||
|
||||
TColgp_Array1OfPnt aTabPnt3d(1, Max(1, nbp3d));
|
||||
TColgp_Array1OfPnt2d aTabPnt2d(1, Max(1, nbp2d));
|
||||
TColgp_Array1OfPnt aPntXYZ(theFpar, theLpar);
|
||||
TColgp_Array1OfPnt2d aPntU1V1(theFpar, theLpar);
|
||||
TColgp_Array1OfPnt2d aPntU2V2(theFpar, theLpar);
|
||||
|
||||
Standard_Integer i, j;
|
||||
|
||||
for (i = theFpar; i <= theLpar; ++i)
|
||||
{
|
||||
if (nbp3d != 0 && nbp2d != 0) aTestLine.Value(i, aTabPnt3d, aTabPnt2d);
|
||||
else if (nbp2d != 0) aTestLine.Value(i, aTabPnt2d);
|
||||
else if (nbp3d != 0) aTestLine.Value(i, aTabPnt3d);
|
||||
//
|
||||
if (nbp3d > 0)
|
||||
{
|
||||
aPntXYZ(i) = aTabPnt3d(1);
|
||||
}
|
||||
if (nbp2d > 1)
|
||||
{
|
||||
aPntU1V1(i) = aTabPnt2d(1);
|
||||
aPntU2V2(i) = aTabPnt2d(2);
|
||||
}
|
||||
else if (nbp2d > 0)
|
||||
{
|
||||
if (theApproxU1V1)
|
||||
{
|
||||
aPntU1V1(i) = aTabPnt2d(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
aPntU2V2(i) = aTabPnt2d(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer aDim = 0;
|
||||
|
||||
if (theApproxXYZ)
|
||||
aDim += 3;
|
||||
if (theApproxU1V1)
|
||||
aDim += 2;
|
||||
if (theApproxU2V2)
|
||||
aDim += 2;
|
||||
|
||||
Standard_Integer aLength = theLpar - theFpar + 1;
|
||||
NCollection_LocalArray<Standard_Real> aCoords(aLength * aDim);
|
||||
for (i = theFpar; i <= theLpar; ++i)
|
||||
{
|
||||
j = (i - theFpar) * aDim;
|
||||
if (theApproxXYZ)
|
||||
{
|
||||
aCoords[j] = aPntXYZ.Value(i).X();
|
||||
++j;
|
||||
aCoords[j] = aPntXYZ.Value(i).Y();
|
||||
++j;
|
||||
aCoords[j] = aPntXYZ.Value(i).Z();
|
||||
++j;
|
||||
}
|
||||
if (theApproxU1V1)
|
||||
{
|
||||
aCoords[j] = aPntU1V1.Value(i).X();
|
||||
++j;
|
||||
aCoords[j] = aPntU1V1.Value(i).Y();
|
||||
++j;
|
||||
}
|
||||
if (theApproxU2V2)
|
||||
{
|
||||
aCoords[j] = aPntU2V2.Value(i).X();
|
||||
++j;
|
||||
aCoords[j] = aPntU2V2.Value(i).Y();
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
//Analysis of curvature
|
||||
const Standard_Real aCritRat = 500.;
|
||||
const Standard_Real aCritParRat = 100.;
|
||||
math_Vector aPars(theFpar, theLpar);
|
||||
Approx_ParametrizationType aParType = Approx_ChordLength;
|
||||
GeomInt_WLApprox::Parameters(aTestLine, theFpar, theLpar, aParType, aPars);
|
||||
TColStd_Array1OfReal aCurv(aPars.Lower(), aPars.Upper());
|
||||
Standard_Real aMaxCurv = 0.;
|
||||
BuildCurvature(aCoords, aDim, aPars, aCurv, aMaxCurv);
|
||||
|
||||
if (aMaxCurv < Precision::PConfusion()
|
||||
|| Precision::IsPositiveInfinite(aMaxCurv))
|
||||
{
|
||||
//Linear case
|
||||
return aParType;
|
||||
}
|
||||
|
||||
Standard_Real aMidCurv = 0.;
|
||||
Standard_Real eps = Epsilon(1.);
|
||||
j = 0;
|
||||
for (i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
|
||||
{
|
||||
if (aMaxCurv - aCurv(i) < eps)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
++j;
|
||||
aMidCurv += aCurv(i);
|
||||
}
|
||||
|
||||
if (j > 1)
|
||||
{
|
||||
aMidCurv /= j;
|
||||
}
|
||||
|
||||
if (aMidCurv <= eps)
|
||||
return aParType;
|
||||
|
||||
Standard_Real aRat = aMaxCurv / aMidCurv;
|
||||
|
||||
if (aRat > aCritRat)
|
||||
{
|
||||
if(aRat > 5.*aCritRat)
|
||||
aParType = Approx_Centripetal;
|
||||
else
|
||||
{
|
||||
Standard_Real aParRat = MaxParamRatio(aPars);
|
||||
if (aParRat > aCritParRat)
|
||||
aParType = Approx_Centripetal;
|
||||
}
|
||||
}
|
||||
|
||||
return aParType;
|
||||
}
|
||||
|
@@ -38,12 +38,15 @@
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <NCollection_LocalArray.hxx>
|
||||
#include <Approx_ParametrizationType.hxx>
|
||||
|
||||
class math_Vector;
|
||||
template <class A> class NCollection_Sequence;
|
||||
template <class A> class NCollection_List;
|
||||
template <class A> class NCollection_Vector;
|
||||
|
||||
class IntPatch_WLine;
|
||||
|
||||
// Corresponds for debug information output.
|
||||
// Debug information is also printed when OCCT_DEBUG defined.
|
||||
//#define APPROXINT_KNOTTOOLS_DEBUG
|
||||
@@ -84,6 +87,22 @@ public:
|
||||
const Standard_Integer theMinNbPnts,
|
||||
NCollection_Vector<Standard_Integer>& theKnots);
|
||||
|
||||
//! Builds discrete curvature
|
||||
Standard_EXPORT static void BuildCurvature(
|
||||
const NCollection_LocalArray<Standard_Real>& theCoords,
|
||||
const Standard_Integer theDim,
|
||||
const math_Vector& thePars,
|
||||
TColStd_Array1OfReal& theCurv,
|
||||
Standard_Real& theMaxCurv);
|
||||
|
||||
//! Defines preferable parametrization type for theWL
|
||||
Standard_EXPORT static Approx_ParametrizationType DefineParType(const Handle(IntPatch_WLine)& theWL,
|
||||
const Standard_Integer theFpar, const Standard_Integer theLpar,
|
||||
const Standard_Boolean theApproxXYZ,
|
||||
const Standard_Boolean theApproxU1V1,
|
||||
const Standard_Boolean theApproxU2V2);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! Compute indices of knots:
|
||||
|
@@ -11,8 +11,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Aspect_DisplayConnection_H__
|
||||
#define _Aspect_DisplayConnection_H__
|
||||
#ifndef Aspect_DisplayConnection_HeaderFile
|
||||
#define Aspect_DisplayConnection_HeaderFile
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Aspect_XAtom.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef ASPECT_POLYGONOFFSETMODE_HEADER
|
||||
#define ASPECT_POLYGONOFFSETMODE_HEADER
|
||||
#ifndef Aspect_PolygonOffsetMode_HeaderFile
|
||||
#define Aspect_PolygonOffsetMode_HeaderFile
|
||||
|
||||
// Enumeration for polygon offset modes
|
||||
|
||||
|
@@ -284,6 +284,35 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
|
||||
// Post-processing options
|
||||
Standard_Boolean bSplitCurve = Standard_False;
|
||||
//
|
||||
// Collect all pairs of Edge/Edge interferences to check if
|
||||
// some faces have to be moved to obtain more precise intersection
|
||||
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger, BOPDS_PairMapHasher> aEEMap;
|
||||
const BOPDS_VectorOfInterfEE& aVEEs = myDS->InterfEE();
|
||||
for (Standard_Integer iEE = 0; iEE < aVEEs.Size(); ++iEE)
|
||||
{
|
||||
const BOPDS_Interf& aEE = aVEEs(iEE);
|
||||
if (!aEE.HasIndexNew())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Standard_Integer nE1, nE2;
|
||||
aEE.Indices(nE1, nE2);
|
||||
|
||||
const Standard_Integer nVN = aEE.IndexNew();
|
||||
|
||||
BOPDS_Pair aPair(nE1, nE2);
|
||||
TColStd_ListOfInteger* pPoints = aEEMap.ChangeSeek(aPair);
|
||||
if (pPoints)
|
||||
{
|
||||
pPoints->Append(nVN);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPoints = aEEMap.Bound(BOPDS_Pair(nE1, nE2), TColStd_ListOfInteger());
|
||||
pPoints->Append(nVN);
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare the pairs of faces for intersection
|
||||
BOPAlgo_VectorOfFaceFace aVFaceFace;
|
||||
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
|
||||
@@ -312,15 +341,87 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is an intersection between edges of the faces.
|
||||
// If there is an intersection, check if there is a shift between the edges
|
||||
// (intersection point is on some distance from the edges), and move one of
|
||||
// the faces to the point of exact edges intersection. This should allow
|
||||
// obtaining more precise intersection curves between the faces
|
||||
// (at least the curves should reach the boundary).
|
||||
// Note, that currently this check considers only closed edges (seam edges).
|
||||
TopoDS_Face aFShifted1 = aF1, aFShifted2 = aF2;
|
||||
// Keep shift value to use it as the tolerance for intersection curves
|
||||
Standard_Real aShiftValue = 0.;
|
||||
|
||||
if (aBAS1.GetType() != GeomAbs_Plane ||
|
||||
aBAS2.GetType() != GeomAbs_Plane) {
|
||||
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
for (TopExp_Explorer aExp1(aF1, TopAbs_EDGE); !isFound && aExp1.More(); aExp1.Next())
|
||||
{
|
||||
const TopoDS_Edge& aE1 = TopoDS::Edge(aExp1.Current());
|
||||
const Standard_Integer nE1 = myDS->Index(aE1);
|
||||
|
||||
for (TopExp_Explorer aExp2(aF2, TopAbs_EDGE); !isFound && aExp2.More(); aExp2.Next())
|
||||
{
|
||||
const TopoDS_Edge& aE2 = TopoDS::Edge(aExp2.Current());
|
||||
const Standard_Integer nE2 = myDS->Index(aE2);
|
||||
|
||||
Standard_Boolean bIsClosed1 = BRep_Tool::IsClosed(aE1, aF1);
|
||||
Standard_Boolean bIsClosed2 = BRep_Tool::IsClosed(aE2, aF2);
|
||||
if (!bIsClosed1 && !bIsClosed2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const TColStd_ListOfInteger* pPoints = aEEMap.Seek(BOPDS_Pair(nE1, nE2));
|
||||
if (!pPoints)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (TColStd_ListOfInteger::Iterator itEEP(*pPoints); itEEP.More(); itEEP.Next())
|
||||
{
|
||||
const Standard_Integer& nVN = itEEP.Value();
|
||||
const TopoDS_Vertex& aVN = TopoDS::Vertex(myDS->Shape(nVN));
|
||||
const gp_Pnt& aPnt = BRep_Tool::Pnt(aVN);
|
||||
|
||||
// Compute points exactly on the edges
|
||||
GeomAPI_ProjectPointOnCurve& aProjPC1 = myContext->ProjPC(aE1);
|
||||
GeomAPI_ProjectPointOnCurve& aProjPC2 = myContext->ProjPC(aE2);
|
||||
aProjPC1.Perform(aPnt);
|
||||
aProjPC2.Perform(aPnt);
|
||||
if (!aProjPC1.NbPoints() && !aProjPC2.NbPoints())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
gp_Pnt aP1 = aProjPC1.NbPoints() > 0 ? aProjPC1.NearestPoint() : aPnt;
|
||||
gp_Pnt aP2 = aProjPC2.NbPoints() > 0 ? aProjPC2.NearestPoint() : aPnt;
|
||||
|
||||
Standard_Real aShiftDist = aP1.Distance(aP2);
|
||||
if (aShiftDist > BRep_Tool::Tolerance(aVN))
|
||||
{
|
||||
// Move one of the faces to the point of exact intersection of edges
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTranslation(bIsClosed1 ? gp_Vec(aP1, aP2) : gp_Vec(aP2, aP1));
|
||||
TopLoc_Location aLoc(aTrsf);
|
||||
(bIsClosed1 ? &aFShifted1 : &aFShifted2)->Move(aLoc);
|
||||
aShiftValue = aShiftDist;
|
||||
isFound = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
BOPAlgo_FaceFace& aFaceFace=aVFaceFace.Appended();
|
||||
//
|
||||
aFaceFace.SetRunParallel (myRunParallel);
|
||||
aFaceFace.SetIndices(nF1, nF2);
|
||||
aFaceFace.SetFaces(aF1, aF2);
|
||||
aFaceFace.SetFaces(aFShifted1, aFShifted2);
|
||||
aFaceFace.SetBoxes (myDS->ShapeInfo (nF1).Box(), myDS->ShapeInfo (nF2).Box());
|
||||
// compute minimal tolerance for the curves
|
||||
Standard_Real aTolFF = ToleranceFF(aBAS1, aBAS2);
|
||||
// Note: in case of faces with closed edges it should not be less than value of the shift
|
||||
Standard_Real aTolFF = Max(aShiftValue, ToleranceFF(aBAS1, aBAS2));
|
||||
aFaceFace.SetTolFF(aTolFF);
|
||||
//
|
||||
IntSurf_ListOfPntOn2S aListOfPnts;
|
||||
|
@@ -12,8 +12,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BOPDS_VectorOfPnt_HeaderFile
|
||||
#define BOPDS_VectorOfPnt_HeaderFile
|
||||
#ifndef BOPDS_VectorOfPoint_HeaderFile
|
||||
#define BOPDS_VectorOfPoint_HeaderFile
|
||||
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <BOPDS_Point.hxx>
|
||||
|
@@ -12,8 +12,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BOPTest_MapOfShapeSet_HeaderFile
|
||||
#define BOPTest_MapOfShapeSet_HeaderFile
|
||||
#ifndef BOPTools_MapOfSet_HeaderFile
|
||||
#define BOPTools_MapOfSet_HeaderFile
|
||||
|
||||
#include <BOPTools_Set.hxx>
|
||||
#include <BOPTools_SetMapHasher.hxx>
|
||||
|
@@ -340,7 +340,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
|
||||
|
||||
if(Only2d && Only3d) {
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
|
||||
Ufin, Udeb);
|
||||
Udeb, Ufin);
|
||||
prj = MKed.Edge();
|
||||
BB.UpdateEdge(TopoDS::Edge(prj),
|
||||
PCur2d,
|
||||
@@ -355,6 +355,10 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
|
||||
#endif
|
||||
Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d);
|
||||
appr.Perform(myMaxSeg, myMaxDegree, myContinuity, Only3d, Only2d);
|
||||
|
||||
if (appr.MaxError3d() > 1.e3 * myTol3d)
|
||||
continue;
|
||||
|
||||
#ifdef OCCT_DEBUG_CHRONO
|
||||
ResultChron(chr_approx,t_approx);
|
||||
approx_count++;
|
||||
|
@@ -106,6 +106,11 @@ public:
|
||||
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
|
||||
|
||||
Standard_EXPORT static void Parameters(const BRepApprox_TheMultiLineOfApprox& Line,
|
||||
const Standard_Integer firstP,
|
||||
const Standard_Integer lastP,
|
||||
const Approx_ParametrizationType Par,
|
||||
math_Vector& TheParameters);
|
||||
|
||||
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepBuilderAPI_BndBoxTreeSelector_Header
|
||||
#define _BRepBuilderAPI_BndBoxTreeSelector_Header
|
||||
#ifndef BRepBuilderAPI_BndBoxTreeSelector_HeaderFile
|
||||
#define BRepBuilderAPI_BndBoxTreeSelector_HeaderFile
|
||||
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepBuilderAPI_VertexInspector_Header
|
||||
#define _BRepBuilderAPI_VertexInspector_Header
|
||||
#ifndef BRepBuilderAPI_VertexInspector_HeaderFile
|
||||
#define BRepBuilderAPI_VertexInspector_HeaderFile
|
||||
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
|
@@ -82,7 +82,7 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2)
|
||||
|
||||
BRepAdaptor_Curve Curv(E);
|
||||
Handle(BRepAdaptor_Curve) HC = new BRepAdaptor_Curve(Curv);
|
||||
myExtCS.Perform(HC->Curve(), U1, U2);
|
||||
myExtCS.Perform(*HC, U1, U2);
|
||||
|
||||
if(!myExtCS.IsDone())
|
||||
return;
|
||||
|
@@ -890,6 +890,11 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
|
||||
if (LastEdge.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
if (FirstEdge.IsNull() || LastEdge.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
BB.Add(NewWire, FirstEdge);
|
||||
|
||||
if (!FirstEdge.IsSame(LastEdge))
|
||||
|
@@ -1978,6 +1978,12 @@ public:
|
||||
return aDeriv.Transformed(mySurfaceTrsf);
|
||||
}
|
||||
|
||||
gp_Dir Normal()
|
||||
{
|
||||
gp_Dir aNormal = mySurfaceProps.Normal();
|
||||
return aNormal.Transformed(mySurfaceTrsf);
|
||||
}
|
||||
|
||||
// Calculate principal curvatures, which consist of minimal and maximal normal curvatures and
|
||||
// the directions on the tangent plane (principal direction) where the extremums are reached
|
||||
void Curvature(gp_Dir& thePrincipalDir1, Standard_Real& theCurvature1,
|
||||
@@ -2016,32 +2022,63 @@ private:
|
||||
//purpose : check the angle at the border between two squares.
|
||||
// Two shares should have a shared front edge.
|
||||
//=======================================================================
|
||||
static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,
|
||||
const Standard_Real theAngleTol)
|
||||
GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngleTol)
|
||||
{
|
||||
Standard_Boolean isSeam = F1.IsEqual(F2);
|
||||
Standard_Boolean isSeam = theFace1.IsEqual(theFace2);
|
||||
|
||||
TopoDS_Edge E = Ed;
|
||||
TopoDS_Edge anEdgeInFace1, anEdgeInFace2;
|
||||
Handle(Geom2d_Curve) aCurve1, aCurve2;
|
||||
|
||||
Standard_Real aFirst, aLast;
|
||||
|
||||
if (!theFace1.IsSame (theFace2) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace1) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace2))
|
||||
{
|
||||
//Find the edge in the face 1: this edge will have correct orientation
|
||||
TopoDS_Face aFace1 = theFace1;
|
||||
aFace1.Orientation (TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo (aFace1, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
|
||||
if (anEdge.IsSame (theEdge))
|
||||
{
|
||||
anEdgeInFace1 = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace1.IsNull())
|
||||
return GeomAbs_C0;
|
||||
|
||||
aCurve1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation (TopAbs_FORWARD);
|
||||
anEdgeInFace2 = anEdgeInFace1;
|
||||
anEdgeInFace2.Reverse();
|
||||
aCurve2 = BRep_Tool::CurveOnSurface (anEdgeInFace2, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
anEdgeInFace1 = anEdgeInFace2 = theEdge;
|
||||
aCurve1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
if (theFace1.IsSame(theFace2))
|
||||
anEdgeInFace2.Reverse();
|
||||
aCurve2 = BRep_Tool::CurveOnSurface (anEdgeInFace2, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
// Check if pcurves exist on both faces of edge
|
||||
Standard_Real aFirst,aLast;
|
||||
E.Orientation(TopAbs_FORWARD);
|
||||
Handle(Geom2d_Curve) aCurve1 = BRep_Tool::CurveOnSurface(E, F1, aFirst, aLast);
|
||||
if(aCurve1.IsNull())
|
||||
return GeomAbs_C0;
|
||||
|
||||
if (isSeam)
|
||||
E.Orientation(TopAbs_REVERSED);
|
||||
Handle(Geom2d_Curve) aCurve2 = BRep_Tool::CurveOnSurface(E, F2, aFirst, aLast);
|
||||
if(aCurve2.IsNull())
|
||||
if (aCurve1.IsNull() || aCurve2.IsNull())
|
||||
return GeomAbs_C0;
|
||||
|
||||
TopLoc_Location aLoc1, aLoc2;
|
||||
Handle(Geom_Surface) aSurface1 = BRep_Tool::Surface(F1, aLoc1);
|
||||
Handle(Geom_Surface) aSurface1 = BRep_Tool::Surface (theFace1, aLoc1);
|
||||
const gp_Trsf& aSurf1Trsf = aLoc1.Transformation();
|
||||
Handle(Geom_Surface) aSurface2 = BRep_Tool::Surface(F2, aLoc2);
|
||||
Handle(Geom_Surface) aSurface2 = BRep_Tool::Surface (theFace2, aLoc2);
|
||||
const gp_Trsf& aSurf2Trsf = aLoc2.Transformation();
|
||||
|
||||
if (aSurface1->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
|
||||
@@ -2058,11 +2095,11 @@ static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, F1.Orientation() == TopAbs_REVERSED);
|
||||
SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, F2.Orientation() == TopAbs_REVERSED);
|
||||
SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, theFace1.Orientation() == TopAbs_REVERSED);
|
||||
SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, theFace2.Orientation() == TopAbs_REVERSED);
|
||||
|
||||
Standard_Real f, l, eps;
|
||||
BRep_Tool::Range(E,f,l);
|
||||
BRep_Tool::Range (theEdge,f,l);
|
||||
Extrema_LocateExtPC ext;
|
||||
Handle(BRepAdaptor_Curve) aHC2;
|
||||
|
||||
@@ -2073,7 +2110,6 @@ static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
const Standard_Real anAngleTol2 = theAngleTol * theAngleTol;
|
||||
|
||||
gp_Vec aDer1, aDer2;
|
||||
gp_Vec aNorm1;
|
||||
Standard_Real aSqLen1, aSqLen2;
|
||||
gp_Dir aCrvDir1[2], aCrvDir2[2];
|
||||
Standard_Real aCrvLen1[2], aCrvLen2[2];
|
||||
@@ -2101,13 +2137,26 @@ static GeomAbs_Shape tgtfaces(const TopoDS_Edge& Ed,
|
||||
aDer2 = aSP2.Derivative();
|
||||
aSqLen2 = aDer2.SquareMagnitude();
|
||||
Standard_Boolean isSmoothSuspect = (aDer1.CrossSquareMagnitude(aDer2) <= anAngleTol2 * aSqLen1 * aSqLen2);
|
||||
if (isSmoothSuspect)
|
||||
{
|
||||
gp_Dir aNormal1 = aSP1.Normal();
|
||||
if (theFace1.Orientation() == TopAbs_REVERSED)
|
||||
aNormal1.Reverse();
|
||||
gp_Dir aNormal2 = aSP2.Normal();
|
||||
if (theFace2.Orientation() == TopAbs_REVERSED)
|
||||
aNormal2.Reverse();
|
||||
|
||||
if (aNormal1 * aNormal2 < 0.)
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
if (!isSmoothSuspect)
|
||||
{
|
||||
// Refine by projection
|
||||
if (aHC2.IsNull())
|
||||
{
|
||||
// adaptor for pcurve on the second surface
|
||||
aHC2 = new BRepAdaptor_Curve (E, F2);
|
||||
aHC2 = new BRepAdaptor_Curve (anEdgeInFace2, theFace2);
|
||||
ext.Initialize(*aHC2, f, l, Precision::PConfusion());
|
||||
}
|
||||
ext.Perform(aSP1.Value(), u);
|
||||
@@ -2303,9 +2352,8 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
|
||||
BRep_Builder B;
|
||||
if(BRep_Tool::Continuity(E,F1,F2)<=GeomAbs_C0){
|
||||
try {
|
||||
GeomAbs_Shape aCont = tgtfaces(E, F1, F2, TolAng);
|
||||
GeomAbs_Shape aCont = ContinuityOfFaces(E, F1, F2, TolAng);
|
||||
B.Continuity(E,F1,F2,aCont);
|
||||
|
||||
}
|
||||
catch(Standard_Failure const&)
|
||||
{
|
||||
@@ -2423,7 +2471,7 @@ Standard_Boolean BRepLib::
|
||||
|
||||
gp_Vec3f aNorm1f, aNorm2f;
|
||||
aPT1->Normal (aFNodF1, aNorm1f);
|
||||
aPT1->Normal (aFNodF2, aNorm2f);
|
||||
aPT2->Normal (aFNodF2, aNorm2f);
|
||||
const gp_XYZ aNorm1 (aNorm1f.x(), aNorm1f.y(), aNorm1f.z());
|
||||
const gp_XYZ aNorm2 (aNorm2f.x(), aNorm2f.y(), aNorm2f.z());
|
||||
const Standard_Real aDot = aNorm1 * aNorm2;
|
||||
|
@@ -202,7 +202,14 @@ public:
|
||||
//! orientation to have matter in the solid. Returns
|
||||
//! False if the solid is unOrientable (open or incoherent)
|
||||
Standard_EXPORT static Standard_Boolean OrientClosedSolid (TopoDS_Solid& solid);
|
||||
|
||||
|
||||
//! Returns the order of continuity between two faces
|
||||
//! connected by an edge
|
||||
Standard_EXPORT static GeomAbs_Shape ContinuityOfFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Standard_Real theAngleTol);
|
||||
|
||||
//! Encodes the Regularity of edges on a Shape.
|
||||
//! Warning: <TolAng> is an angular tolerance, expressed in Rad.
|
||||
//! Warning: If the edges's regularity are coded before, nothing
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BRepMesh_CircleInspector_Header
|
||||
#define BRepMesh_CircleInspector_Header
|
||||
#ifndef BRepMesh_CircleInspector_HeaderFile
|
||||
#define BRepMesh_CircleInspector_HeaderFile
|
||||
|
||||
#include <IMeshData_Types.hxx>
|
||||
#include <BRepMesh_Circle.hxx>
|
||||
|
@@ -126,10 +126,12 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance(
|
||||
const Standard_Real aDiffU = myRangeU.second - myRangeU.first;
|
||||
const Standard_Real aDiffV = myRangeV.second - myRangeV.first;
|
||||
|
||||
// Slightly increase exact resolution so to cover links with approximate
|
||||
// length equal to resolution itself on sub-resolution differences.
|
||||
const Standard_Real aTolerance = BRep_Tool::Tolerance (myDFace->GetFace());
|
||||
const Adaptor3d_Surface& aSurface = GetSurface()->Surface();
|
||||
const Standard_Real aResU = aSurface.UResolution (aTolerance);
|
||||
const Standard_Real aResV = aSurface.VResolution (aTolerance);
|
||||
const Standard_Real aResU = aSurface.UResolution (aTolerance) * 1.1;
|
||||
const Standard_Real aResV = aSurface.VResolution (aTolerance) * 1.1;
|
||||
|
||||
const Standard_Real aDeflectionUV = 1.e-05;
|
||||
myTolerance.first = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU);
|
||||
|
@@ -45,7 +45,8 @@ namespace
|
||||
void operator()(const Standard_Integer theFaceIndex) const
|
||||
{
|
||||
const IMeshData::IFaceHandle& aDFace = myModel->GetFace(theFaceIndex);
|
||||
if (aDFace->IsSet(IMeshData_Outdated))
|
||||
if (aDFace->IsSet(IMeshData_Outdated) ||
|
||||
aDFace->GetFace().IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -118,7 +119,7 @@ namespace
|
||||
void operator()(const Standard_Integer theFaceIndex) const
|
||||
{
|
||||
const IMeshData::IFaceHandle& aDFace = myModel->GetFace(theFaceIndex);
|
||||
if (aDFace->GetSurface()->GetType() != GeomAbs_Cone)
|
||||
if (aDFace->GetSurface()->GetType() != GeomAbs_Cone || aDFace->IsSet(IMeshData_Failure))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -127,12 +128,12 @@ namespace
|
||||
for (Standard_Integer aEdgeIdx = 0; aEdgeIdx < aDWire->EdgesNb() - 1; ++aEdgeIdx)
|
||||
{
|
||||
const IMeshData::IEdgePtr& aDEdge = aDWire->GetEdge (aEdgeIdx);
|
||||
|
||||
|
||||
if (aDEdge->GetPCurve(aDFace.get(), TopAbs_FORWARD) != aDEdge->GetPCurve(aDFace.get(), TopAbs_REVERSED))
|
||||
{
|
||||
if (aDEdge->GetCurve()->ParametersNb() == 2)
|
||||
{
|
||||
if (splitEdge (aDEdge, Abs (getConeStep (aDFace))))
|
||||
if (splitEdge (aDEdge, aDFace, Abs (getConeStep (aDFace))))
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
const Handle (Poly_Triangulation)& aTriangulation =
|
||||
@@ -145,7 +146,7 @@ namespace
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,48 +178,89 @@ namespace
|
||||
}
|
||||
|
||||
//! Splits 3D and all pcurves accordingly using the specified step.
|
||||
Standard_Boolean splitEdge(const IMeshData::IEdgePtr& theDEdge,
|
||||
const Standard_Real theDU) const
|
||||
Standard_Boolean splitEdge(const IMeshData::IEdgePtr& theDEdge,
|
||||
const IMeshData::IFaceHandle& theDFace,
|
||||
const Standard_Real theDU) const
|
||||
{
|
||||
if (!splitCurve<gp_XYZ> (theDEdge->GetCurve (), theDU))
|
||||
TopoDS_Edge aE = theDEdge->GetEdge();
|
||||
const TopoDS_Face& aF = theDFace->GetFace();
|
||||
|
||||
Standard_Real aFParam, aLParam;
|
||||
|
||||
Handle(Geom_Curve) aHC = BRep_Tool::Curve (aE, aFParam, aLParam);
|
||||
|
||||
const IMeshData::IPCurveHandle& aIPC1 = theDEdge->GetPCurve(0);
|
||||
const IMeshData::IPCurveHandle& aIPC2 = theDEdge->GetPCurve(1);
|
||||
|
||||
// Calculate the step by parameter of the curve.
|
||||
const gp_Pnt2d& aFPntOfIPC1 = aIPC1->GetPoint (0);
|
||||
const gp_Pnt2d& aLPntOfIPC1 = aIPC1->GetPoint (aIPC1->ParametersNb() - 1);
|
||||
const Standard_Real aMod = Abs (aFPntOfIPC1.Y() - aLPntOfIPC1.Y());
|
||||
|
||||
if (aMod < gp::Resolution())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
for (Standard_Integer aPCurveIdx = 0; aPCurveIdx < theDEdge->PCurvesNb(); ++aPCurveIdx)
|
||||
const Standard_Real aDT = Abs (aLParam - aFParam) / aMod * theDU;
|
||||
|
||||
if (!splitCurve<gp_Pnt> (aHC, theDEdge->GetCurve(), aDT))
|
||||
{
|
||||
splitCurve<gp_XY> (theDEdge->GetPCurve (aPCurveIdx), theDU);
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// Define two pcurves of the seam-edge.
|
||||
Handle(Geom2d_Curve) aPC1, aPC2;
|
||||
Standard_Real af, al;
|
||||
|
||||
aE.Orientation (TopAbs_FORWARD);
|
||||
aPC1 = BRep_Tool::CurveOnSurface (aE, aF, af, al);
|
||||
|
||||
aE.Orientation (TopAbs_REVERSED);
|
||||
aPC2 = BRep_Tool::CurveOnSurface (aE, aF, af, al);
|
||||
|
||||
if (aPC1.IsNull() || aPC2.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// Select the correct pcurve of the seam-edge.
|
||||
const gp_Pnt2d& aFPntOfPC1 = aPC1->Value (aPC1->FirstParameter());
|
||||
|
||||
if (Abs (aLPntOfIPC1.X() - aFPntOfPC1.X()) > Precision::Confusion())
|
||||
{
|
||||
std::swap (aPC1, aPC2);
|
||||
}
|
||||
|
||||
splitCurve<gp_Pnt2d> (aPC1, aIPC1, aDT);
|
||||
splitCurve<gp_Pnt2d> (aPC2, aIPC2, aDT);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Splits the given curve using the specified step.
|
||||
template<class PointType, class Curve>
|
||||
Standard_Boolean splitCurve(Curve& theCurve, const Standard_Real theDU) const
|
||||
template<class PointType, class GeomCurve, class Curve>
|
||||
Standard_Boolean splitCurve(GeomCurve& theGeomCurve,
|
||||
Curve& theCurve,
|
||||
const Standard_Real theDT) const
|
||||
{
|
||||
Standard_Boolean isUpdated = Standard_False;
|
||||
PointType aDir = theCurve->GetPoint(theCurve->ParametersNb() - 1).Coord() - theCurve->GetPoint(0).Coord();
|
||||
const Standard_Real aModulus = aDir.Modulus();
|
||||
if (aModulus < gp::Resolution())
|
||||
{
|
||||
return isUpdated;
|
||||
}
|
||||
aDir /= aModulus;
|
||||
|
||||
const Standard_Real aLastParam = theCurve->GetParameter(theCurve->ParametersNb() - 1);
|
||||
const Standard_Boolean isReversed = theCurve->GetParameter(0) > aLastParam;
|
||||
const Standard_Real aFirstParam = theCurve->GetParameter (0);
|
||||
const Standard_Real aLastParam = theCurve->GetParameter (theCurve->ParametersNb() - 1);
|
||||
const Standard_Boolean isReversed = aFirstParam > aLastParam;
|
||||
|
||||
for (Standard_Integer aPointIdx = 1; ; ++aPointIdx)
|
||||
{
|
||||
const Standard_Real aCurrParam = theCurve->GetParameter(0) + aPointIdx * theDU * (isReversed ? -1.0 : 1.0);
|
||||
if (( isReversed && (aCurrParam < aLastParam)) ||
|
||||
(!isReversed && !(aCurrParam < aLastParam)))
|
||||
const Standard_Real aCurrParam = aFirstParam + aPointIdx * theDT * (isReversed ? -1.0 : 1.0);
|
||||
if (( isReversed && (aCurrParam - aLastParam < Precision::PConfusion())) ||
|
||||
(!isReversed && !(aCurrParam - aLastParam < - Precision::PConfusion())))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
theCurve->InsertPoint(theCurve->ParametersNb() - 1,
|
||||
theCurve->GetPoint(0).Translated (aDir * aPointIdx * theDU),
|
||||
theCurve->InsertPoint (theCurve->ParametersNb() - 1,
|
||||
theGeomCurve->Value (aCurrParam),
|
||||
aCurrParam);
|
||||
|
||||
isUpdated = Standard_True;
|
||||
|
@@ -52,6 +52,7 @@
|
||||
#include <BOPAlgo_PaveFiller.hxx>
|
||||
#include <BOPAlgo_Section.hxx>
|
||||
#include <BOPAlgo_Splitter.hxx>
|
||||
#include <BOPAlgo_BOP.hxx>
|
||||
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
@@ -107,6 +108,19 @@ namespace {
|
||||
{
|
||||
BRep_Builder().Add (theSOut, theS);
|
||||
}
|
||||
static void AddToContainer (const TopoDS_Shape& theKey,
|
||||
const TopoDS_Shape& theValue,
|
||||
TopTools_DataMapOfShapeListOfShape& theMap)
|
||||
{
|
||||
if (TopTools_ListOfShape* pList = theMap.ChangeSeek (theKey))
|
||||
{
|
||||
pList->Append (theValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
theMap.Bound (theKey, TopTools_ListOfShape())->Append (theValue);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TakeModified
|
||||
@@ -617,7 +631,9 @@ private: //! @name Intersection and post-treatment of edges
|
||||
|
||||
//! Filtering the invalid edges according to currently invalid faces
|
||||
void FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
|
||||
const TopTools_IndexedMapOfShape& theMERemoved);
|
||||
const TopTools_IndexedMapOfShape& theMERemoved,
|
||||
const TopTools_IndexedMapOfShape& theMEInside,
|
||||
TopTools_MapOfShape& theMEUseInRebuild);
|
||||
|
||||
private: //! @name Checking faces
|
||||
|
||||
@@ -766,6 +782,7 @@ private: //! @name Checking faces
|
||||
const TopTools_MapOfShape& theVertsToAvoid,
|
||||
const TopTools_MapOfShape& theNewVertsToAvoid,
|
||||
const TopTools_MapOfShape& theMECheckExt,
|
||||
const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
|
||||
TopTools_MapOfShape& theMVBounds,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages);
|
||||
|
||||
@@ -877,16 +894,18 @@ private:
|
||||
TopTools_IndexedMapOfShape myEdgesToAvoid; //!< Splits of edges to be avoided when building splits of faces
|
||||
TopTools_MapOfShape myLastInvEdges; //!< Edges marked invalid on the current step and to be avoided on the next step
|
||||
TopTools_MapOfShape myModifiedEdges; //!< Edges to be used for building splits
|
||||
TopTools_IndexedMapOfShape myInsideEdges; //!< Edges located fully inside solids built from the splits of offset faces
|
||||
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myInvalidFaces; //!< Invalid faces - splits of offset faces consisting of invalid edges
|
||||
TopTools_DataMapOfShapeShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
|
||||
//! to be rebuilt on the future steps in the situations when invalid edges
|
||||
//! are present, but invalid faces not
|
||||
BRepOffset_DataMapOfShapeIndexedMapOfShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
|
||||
//! to be rebuilt on the future steps in the situations when invalid edges
|
||||
//! are present, but invalid faces not
|
||||
TopTools_DataMapOfShapeInteger myAlreadyInvFaces; //!< Count number of the same face being marked invalid to avoid infinite
|
||||
//! rebuilding of the same face
|
||||
TopTools_DataMapOfShapeListOfShape myFNewHoles; //!< Images of the hole faces of the original face
|
||||
|
||||
TopTools_DataMapOfShapeListOfShape mySSInterfs; //!< Intersection information, used to collect intersection pairs during rebuild
|
||||
TopTools_DataMapOfShapeListOfShape mySSInterfsArt; //!< Intersection information, used to collect intersection pairs during rebuild
|
||||
NCollection_DataMap <TopoDS_Shape,
|
||||
BRepOffset_DataMapOfShapeMapOfShape,
|
||||
TopTools_ShapeMapHasher> myIntersectionPairs; //!< All possible intersection pairs, used to avoid some of the intersections
|
||||
@@ -1004,6 +1023,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces (const Message_Prog
|
||||
myInvalidEdges.Clear();
|
||||
myInvertedEdges.Clear();
|
||||
mySSInterfs.Clear();
|
||||
mySSInterfsArt.Clear();
|
||||
myIntersectionPairs.Clear();
|
||||
mySolids.Nullify();
|
||||
myFacesToRebuild.Clear();
|
||||
@@ -1299,9 +1319,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
|
||||
//
|
||||
if (bArtificialCase)
|
||||
{
|
||||
TopTools_IndexedMapOfShape aMEInv;
|
||||
// make the face invalid
|
||||
myArtInvalidFaces.Bind (aF, aCE);
|
||||
TopTools_IndexedMapOfShape aMEInv;
|
||||
//
|
||||
*pLFIm = aLFImages;
|
||||
TopTools_ListIteratorOfListOfShape aItLFIm (aLFImages);
|
||||
@@ -1324,6 +1343,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
|
||||
}
|
||||
}
|
||||
//
|
||||
myArtInvalidFaces.Bind (aF, aMEInv);
|
||||
aDMFMIE.Bind (aF, aMEInv);
|
||||
aLFDone.Append (aF);
|
||||
//
|
||||
@@ -1519,9 +1539,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
|
||||
RemoveInvalidSplitsFromValid (aDMFMVIE);
|
||||
//
|
||||
// remove inside faces
|
||||
TopTools_IndexedMapOfShape aMEInside;
|
||||
RemoveInsideFaces (anInvertedFaces, aMFToCheckInt, aMFInvInHole, aFHoles,
|
||||
aMERemoved, aMEInside, aPSOuter.Next (5.));
|
||||
aMERemoved, myInsideEdges, aPSOuter.Next (5.));
|
||||
//
|
||||
// make compound of valid splits
|
||||
TopoDS_Compound aCFIm;
|
||||
@@ -1546,7 +1565,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
|
||||
FilterEdgesImages (aCFIm);
|
||||
//
|
||||
// filter invalid faces
|
||||
FilterInvalidFaces (aDMEF, aMEInside);
|
||||
FilterInvalidFaces (aDMEF, aMERemoved.Extent() ? myInsideEdges : aMERemoved);
|
||||
aNb = myInvalidFaces.Extent();
|
||||
if (!aNb)
|
||||
{
|
||||
@@ -1572,7 +1591,10 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
|
||||
#endif
|
||||
//
|
||||
// filter invalid edges
|
||||
FilterInvalidEdges (aDMFMIE, aMERemoved);
|
||||
TopTools_MapOfShape aMEUseInRebuild;
|
||||
FilterInvalidEdges (aDMFMIE, aMERemoved,
|
||||
aMERemoved.Extent() ? myInsideEdges : aMERemoved,
|
||||
aMEUseInRebuild);
|
||||
//
|
||||
// Check additionally validity of edges originated from vertices.
|
||||
CheckEdgesCreatedByVertex();
|
||||
@@ -1594,8 +1616,11 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
|
||||
for (i = 1; i <= aNb; ++i)
|
||||
{
|
||||
const TopoDS_Shape& aE = myInvalidEdges (i);
|
||||
myEdgesToAvoid.Add (aE);
|
||||
myLastInvEdges.Add (aE);
|
||||
if (!aMEUseInRebuild.Contains(aE))
|
||||
{
|
||||
myEdgesToAvoid.Add (aE);
|
||||
}
|
||||
}
|
||||
//
|
||||
aNb = myInvalidFaces.Extent();
|
||||
@@ -1793,11 +1818,10 @@ Standard_Boolean BRepOffset_BuildOffsetFaces::CheckIfArtificial (const TopoDS_Sh
|
||||
{
|
||||
const TopoDS_Edge& aE = TopoDS::Edge (aItLE.Value());
|
||||
//
|
||||
if (myOEImages.IsBound (aE))
|
||||
if (const TopTools_ListOfShape* pLEIm = myOEImages.Seek (aE))
|
||||
{
|
||||
Standard_Boolean bChecked = Standard_False;
|
||||
const TopTools_ListOfShape& aLEIm = myOEImages.Find (aE);
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm (aLEIm);
|
||||
TopTools_ListIteratorOfListOfShape aItLEIm (*pLEIm);
|
||||
for (; aItLEIm.More(); aItLEIm.Next())
|
||||
{
|
||||
const TopoDS_Edge& aEIm = TopoDS::Edge (aItLEIm.Value());
|
||||
@@ -4165,6 +4189,7 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
|
||||
RemoveInvalidSplits (aMFToRem, aMV, theMERemoved);
|
||||
//
|
||||
// Get inside faces from the removed ones comparing them with boundary edges
|
||||
theMEInside.Clear();
|
||||
aNb = theMERemoved.Extent();
|
||||
for (i = 1; i <= aNb; ++i)
|
||||
{
|
||||
@@ -4189,6 +4214,28 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
|
||||
void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfShapeShape& theDMFOr,
|
||||
BOPAlgo_Builder& theBuilder)
|
||||
{
|
||||
// Make connexity blocks from invalid edges to use the whole block
|
||||
// to which the edge is connected instead of the single edge.
|
||||
TopoDS_Compound aCEInv;
|
||||
BRep_Builder().MakeCompound(aCEInv);
|
||||
for (Standard_Integer i = 1; i <= myInvalidEdges.Extent(); ++i)
|
||||
{
|
||||
AddToContainer (myInvalidEdges(i), aCEInv);
|
||||
}
|
||||
|
||||
TopTools_ListOfShape aLCB;
|
||||
BOPTools_AlgoTools::MakeConnexityBlocks (aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCB);
|
||||
|
||||
// Binding from the edge to the block
|
||||
TopTools_DataMapOfShapeShape aECBMap;
|
||||
for (TopTools_ListOfShape::Iterator itCB(aLCB); itCB.More(); itCB.Next())
|
||||
{
|
||||
for (TopoDS_Iterator itE(itCB.Value()); itE.More(); itE.Next())
|
||||
{
|
||||
aECBMap.Bind(itE.Value(), itCB.Value());
|
||||
}
|
||||
}
|
||||
|
||||
// update invalid edges with images and keep connection to original edge
|
||||
TopTools_DataMapOfShapeListOfShape aDMEOr;
|
||||
Standard_Integer aNb = myInvalidEdges.Extent();
|
||||
@@ -4206,13 +4253,7 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
|
||||
for (; aItLEIm.More(); aItLEIm.Next())
|
||||
{
|
||||
const TopoDS_Shape& aEIm = aItLEIm.Value();
|
||||
//
|
||||
TopTools_ListOfShape* pLEOr = aDMEOr.ChangeSeek (aEIm);
|
||||
if (!pLEOr)
|
||||
{
|
||||
pLEOr = aDMEOr.Bound (aEIm, TopTools_ListOfShape());
|
||||
}
|
||||
AppendToList (*pLEOr, aEInv);
|
||||
AddToContainer (aEIm, aEInv, aDMEOr);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -4365,6 +4406,121 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
|
||||
AppendToList (*pLF, aFOp);
|
||||
}
|
||||
}
|
||||
|
||||
// Treatment for the artificial case - check if one of the faces is artificially invalid
|
||||
for (Standard_Integer iF = 0; iF < 2; ++iF)
|
||||
{
|
||||
const TopoDS_Shape& aFArt = !iF ? *pF1 : *pF2;
|
||||
const TopoDS_Shape& aFOpposite = !iF ? *pF2 : *pF1;
|
||||
|
||||
if (!myArtInvalidFaces.IsBound (aFArt))
|
||||
continue;
|
||||
|
||||
if (myInvalidFaces.Contains (aFOpposite) && !myArtInvalidFaces.IsBound (aFOpposite))
|
||||
continue;
|
||||
|
||||
// Collect own invalid edges of the face and the invalid edges connected to those
|
||||
// own invalid edges to be avoided in the check for intersection.
|
||||
TopTools_IndexedMapOfShape aMEAvoid;
|
||||
if (const TopTools_IndexedMapOfShape* pFEInv = myArtInvalidFaces.Seek (aFOpposite))
|
||||
{
|
||||
for (Standard_Integer iE = 1; iE <= pFEInv->Extent(); ++iE)
|
||||
{
|
||||
if (const TopoDS_Shape* pCB = aECBMap.Seek (pFEInv->FindKey(iE)))
|
||||
{
|
||||
TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (const TopTools_ListOfShape* pLFIm = myOFImages.Seek (aFOpposite))
|
||||
{
|
||||
for (TopTools_ListOfShape::Iterator itLFIm (*pLFIm); itLFIm.More(); itLFIm.Next())
|
||||
{
|
||||
for (TopExp_Explorer expE (itLFIm.Value(), TopAbs_EDGE); expE.More(); expE.Next())
|
||||
{
|
||||
if (const TopoDS_Shape* pCB = aECBMap.Seek (expE.Current()))
|
||||
{
|
||||
TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const TopoDS_Shape& aFArtIm = !iF ? aFIm1 : aFIm2;
|
||||
const TopoDS_Shape& aFOppositeIm = !iF ? aFIm2 : aFIm1;
|
||||
|
||||
// Check if there are any intersections between edges of artificially
|
||||
// invalid face and opposite face
|
||||
const Standard_Integer nFOp = pDS->Index (aFOppositeIm);
|
||||
|
||||
for (TopExp_Explorer expE (aFArtIm, TopAbs_EDGE); expE.More(); expE.Next())
|
||||
{
|
||||
const TopoDS_Shape& aE = expE.Current();
|
||||
if (!myInvalidEdges.Contains (aE) || myInvertedEdges.Contains (aE) || aMEAvoid.Contains (aE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const Standard_Integer nE = pDS->Index (aE);
|
||||
if (nE < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!pDS->HasInterf(nE, nFOp))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TopTools_ListOfShape aLV;
|
||||
const BOPDS_VectorOfInterfEF& aEFs = pDS->InterfEF();
|
||||
for (Standard_Integer iEF = 0; iEF < aEFs.Size(); ++iEF)
|
||||
{
|
||||
const BOPDS_InterfEF& aEF = aEFs (iEF);
|
||||
if (aEF.Contains (nE) && aEF.Contains(nFOp))
|
||||
{
|
||||
if (aEF.CommonPart().Type() == TopAbs_VERTEX)
|
||||
aLV.Append (pDS->Shape (aEF.IndexNew()));
|
||||
}
|
||||
}
|
||||
|
||||
if (aLV.IsEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Make sure that there is an opposite intersection exists, i.e. some of the edges
|
||||
// of the opposite face intersect the artificially invalid face.
|
||||
const Standard_Integer nFArt = pDS->Index (aFArtIm);
|
||||
TopExp_Explorer expEOp (aFOppositeIm, TopAbs_EDGE);
|
||||
for (; expEOp.More(); expEOp.Next())
|
||||
{
|
||||
const TopoDS_Shape& aEOp = expEOp.Current();
|
||||
const Standard_Integer nEOp = pDS->Index (aEOp);
|
||||
if (pDS->HasInterf(nEOp, nFArt))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!expEOp.More())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Intersection is present - add connection between offset faces.
|
||||
AddToContainer (aFArt, aFOpposite, mySSInterfsArt);
|
||||
|
||||
// Add connection between edge and opposite face
|
||||
AddToContainer (aE, aFOpposite, mySSInterfsArt);
|
||||
|
||||
// Along with the opposite face, save the intersection vertices to
|
||||
// be used for trimming the intersection edge in the rebuilding process
|
||||
for (TopTools_ListOfShape::Iterator itLV (aLV); itLV.More(); itLV.Next())
|
||||
{
|
||||
// Add connection to intersection vertex
|
||||
AddToContainer (aE, itLV.Value(), mySSInterfsArt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4960,7 +5116,9 @@ void BRepOffset_BuildOffsetFaces::CheckEdgesCreatedByVertex()
|
||||
//purpose : Filtering the invalid edges according to currently invalid faces
|
||||
//=======================================================================
|
||||
void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
|
||||
const TopTools_IndexedMapOfShape& theMERemoved)
|
||||
const TopTools_IndexedMapOfShape& theMERemoved,
|
||||
const TopTools_IndexedMapOfShape& theMEInside,
|
||||
TopTools_MapOfShape& theMEUseInRebuild)
|
||||
{
|
||||
TopoDS_Compound aCEInv;
|
||||
TopTools_IndexedMapOfShape aMEInv;
|
||||
@@ -5023,14 +5181,16 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
|
||||
const TopoDS_Shape& aF = myInvalidFaces.FindKey (i);
|
||||
if (myArtInvalidFaces.IsBound (aF))
|
||||
{
|
||||
const TopTools_IndexedMapOfShape& aMIE = theDMFMIE.Find (aF);
|
||||
const Standard_Integer aNbIE = aMIE.Extent();
|
||||
for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
|
||||
if (const TopTools_IndexedMapOfShape* aMIE = theDMFMIE.Seek (aF))
|
||||
{
|
||||
const TopoDS_Shape& aE = aMIE (iE);
|
||||
if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
|
||||
const Standard_Integer aNbIE = aMIE->Extent();
|
||||
for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
|
||||
{
|
||||
aReallyInvEdges.Add (aE);
|
||||
const TopoDS_Shape& aE = aMIE->FindKey (iE);
|
||||
if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
|
||||
{
|
||||
aReallyInvEdges.Add (aE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5053,8 +5213,46 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
myInvalidEdges = aReallyInvEdges;
|
||||
|
||||
// Check if any of the currently invalid edges may be used for
|
||||
// rebuilding splits of invalid faces.
|
||||
// For that the edge should be inside and not connected to invalid
|
||||
// boundary edges of the same origin.
|
||||
|
||||
aNb = myInvalidEdges.Extent();
|
||||
for (i = 1; i <= aNb; ++i)
|
||||
{
|
||||
const TopoDS_Shape& aE = myInvalidEdges (i);
|
||||
if (!theMEInside.Contains (aE) || !myValidEdges.Contains (aE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
|
||||
if (!pEOrigins)
|
||||
{
|
||||
theMEUseInRebuild.Add (aE);
|
||||
continue;
|
||||
}
|
||||
|
||||
Standard_Boolean bHasInvOutside = Standard_False;
|
||||
for (TopTools_ListOfShape::Iterator itEOr (*pEOrigins); !bHasInvOutside && itEOr.More(); itEOr.Next())
|
||||
{
|
||||
if (const TopTools_ListOfShape* pEIms = myOEImages.Seek (itEOr.Value()))
|
||||
{
|
||||
for (TopTools_ListOfShape::Iterator itEIms (*pEIms); !bHasInvOutside && itEIms.More(); itEIms.Next())
|
||||
{
|
||||
bHasInvOutside = myInvalidEdges.Contains (itEIms.Value()) && !theMEInside.Contains (itEIms.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!bHasInvOutside)
|
||||
{
|
||||
theMEUseInRebuild.Add (aE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -5116,7 +5314,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
|
||||
aDMFLV.Bind (aF, aLVAvoid);
|
||||
}
|
||||
//
|
||||
const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aF);
|
||||
const TopTools_ListOfShape* pLF = !myArtInvalidFaces.IsBound(aF) ? mySSInterfs.Seek (aF) : mySSInterfsArt.Seek(aF);
|
||||
if (pLF)
|
||||
{
|
||||
TopTools_ListIteratorOfListOfShape aItLFE (*pLF);
|
||||
@@ -5275,7 +5473,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
||||
TopTools_DataMapOfShapeShape aDMFImF;
|
||||
TopoDS_Compound aCFArt;
|
||||
BRep_Builder().MakeCompound (aCFArt);
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeShape aItM (myArtInvalidFaces);
|
||||
BRepOffset_DataMapOfShapeIndexedMapOfShape::Iterator aItM (myArtInvalidFaces);
|
||||
for (; aItM.More(); aItM.Next())
|
||||
{
|
||||
const TopoDS_Shape& aF = aItM.Key();
|
||||
@@ -5597,9 +5795,13 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopTools_ListOfShape& aLFImi = myOFImages.FindFromKey (aFi);
|
||||
const TopTools_ListOfShape* aLFImi = myOFImages.Seek (aFi);
|
||||
if (!aLFImi)
|
||||
continue;
|
||||
//
|
||||
TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey (aFi);
|
||||
TopTools_ListOfShape* aLFEi = aFLE.ChangeSeek (aFi);
|
||||
if (!aLFEi)
|
||||
continue;
|
||||
//
|
||||
TopTools_ListOfShape& aLFDone = aMDone.ChangeFind (aFi);
|
||||
//
|
||||
@@ -5618,20 +5820,42 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
||||
if (pInterFi && !pInterFi->Contains (aFj))
|
||||
continue;
|
||||
|
||||
const TopTools_ListOfShape& aLFImj = myOFImages.FindFromKey (aFj);
|
||||
const TopTools_ListOfShape* aLFImj = myOFImages.Seek(aFj);
|
||||
if (!aLFImj)
|
||||
continue;
|
||||
//
|
||||
TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey (aFj);
|
||||
TopTools_ListOfShape* aLFEj = aFLE.ChangeSeek (aFj);
|
||||
if (!aLFEj)
|
||||
continue;
|
||||
|
||||
//
|
||||
// if there are some common edges between faces
|
||||
// we should use these edges and do not intersect again.
|
||||
TopTools_ListOfShape aLEC;
|
||||
FindCommonParts (aLFImi, aLFImj, aLEC);
|
||||
FindCommonParts (*aLFImi, *aLFImj, aLEC);
|
||||
//
|
||||
if (aLEC.Extent())
|
||||
{
|
||||
// no need to intersect if we have common edges between faces
|
||||
Standard_Boolean bForceUse = aMFIntExt.Contains (aFi) || aMFIntExt.Contains (aFj);
|
||||
ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, aLFEi, aLFEj, aMEToInt);
|
||||
ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, *aLFEi, *aLFEj, aMEToInt);
|
||||
|
||||
// Add common vertices not belonging to the common edges for trimming the intersection edges
|
||||
TopTools_IndexedMapOfShape aMVOnCE;
|
||||
for (TopTools_ListOfShape::Iterator itE (aLEC); itE.More(); itE.Next())
|
||||
{
|
||||
TopExp::MapShapes (itE.Value(), TopAbs_VERTEX, aMVOnCE);
|
||||
}
|
||||
|
||||
TopTools_ListOfShape aLEV;
|
||||
FindCommonParts (*aLFImi, *aLFImj, aLEV, TopAbs_VERTEX);
|
||||
for (TopTools_ListOfShape::Iterator itV (aLEV); itV.More(); itV.Next())
|
||||
{
|
||||
if (!aMVOnCE.Contains (itV.Value()))
|
||||
{
|
||||
aMECV.Add (itV.Value());
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
//
|
||||
@@ -5657,7 +5881,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
||||
{
|
||||
// use intersection line obtained on the previous steps
|
||||
// plus, find new origins for these lines
|
||||
UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMEToInt);
|
||||
UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMEToInt);
|
||||
continue;
|
||||
}
|
||||
//
|
||||
@@ -5669,13 +5893,14 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
|
||||
aLFDone.Append (aFj);
|
||||
aMDone.ChangeFind (aFj).Append (aFi);
|
||||
//
|
||||
IntersectFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMECV, aMEToInt);
|
||||
IntersectFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMECV, aMEToInt);
|
||||
}
|
||||
}
|
||||
//
|
||||
// intersect and trim edges for this chain
|
||||
IntersectAndTrimEdges (aMFInt, aMEToInt, aDMEETrim, aME, aMECV,
|
||||
aMVInv, aMVRInv, aMECheckExt, aMVBounds, aEImages);
|
||||
aMVInv, aMVRInv, aMECheckExt, bArtificial ? &mySSInterfsArt : 0,
|
||||
aMVBounds, aEImages);
|
||||
//
|
||||
Standard_Integer iE, aNbEToInt = aMEToInt.Extent();
|
||||
for (iE = 1; iE <= aNbEToInt; ++iE)
|
||||
@@ -5956,12 +6181,8 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
|
||||
}
|
||||
}
|
||||
//
|
||||
if (theArtCase)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//
|
||||
const TopTools_ListOfShape* pLFInv = mySSInterfs.Seek (theFInv);
|
||||
const TopTools_DataMapOfShapeListOfShape& aSSInterfsMap = theArtCase ? mySSInterfsArt : mySSInterfs;
|
||||
const TopTools_ListOfShape* pLFInv = aSSInterfsMap.Seek (theFInv);
|
||||
if (!pLFInv)
|
||||
{
|
||||
return;
|
||||
@@ -5985,7 +6206,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
|
||||
for (i = 1; i <= aNbE; ++i)
|
||||
{
|
||||
const TopoDS_Shape& aS = theME (i);
|
||||
const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aS);
|
||||
const TopTools_ListOfShape* pLF = aSSInterfsMap.Seek (aS);
|
||||
if (!pLF)
|
||||
{
|
||||
continue;
|
||||
@@ -6002,30 +6223,33 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
|
||||
//
|
||||
// check if the face has some connection to already added for intersection faces
|
||||
const TopTools_ListOfShape& aLFIm = myOFImages.FindFromKey (aF);
|
||||
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
|
||||
for (; aItLFIm.More(); aItLFIm.Next())
|
||||
if (!theArtCase)
|
||||
{
|
||||
const TopoDS_Shape& aFIm = aItLFIm.Value();
|
||||
TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next())
|
||||
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
|
||||
for (; aItLFIm.More(); aItLFIm.Next())
|
||||
{
|
||||
if (aMShapes.Contains (aExp.Current()))
|
||||
const TopoDS_Shape& aFIm = aItLFIm.Value();
|
||||
TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next())
|
||||
{
|
||||
if (aMShapes.Contains (aExp.Current()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (aExp.More())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (aExp.More())
|
||||
if (!aItLFIm.More())
|
||||
{
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!aItLFIm.More())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aMFToAdd.Add (aF);
|
||||
aItLFIm.Initialize (aLFIm);
|
||||
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
|
||||
for (; aItLFIm.More(); aItLFIm.Next())
|
||||
{
|
||||
const TopoDS_Shape& aFIm = aItLFIm.Value();
|
||||
@@ -6423,6 +6647,7 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
|
||||
const TopTools_MapOfShape& theVertsToAvoid,
|
||||
const TopTools_MapOfShape& theNewVertsToAvoid,
|
||||
const TopTools_MapOfShape& theMECheckExt,
|
||||
const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
|
||||
TopTools_MapOfShape& theMVBounds,
|
||||
TopTools_DataMapOfShapeListOfShape& theEImages)
|
||||
{
|
||||
@@ -6468,30 +6693,39 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
|
||||
aNb = theMSInv.Extent();
|
||||
for (i = 1; i <= aNb; ++i)
|
||||
{
|
||||
const TopoDS_Shape& aV = theMSInv (i);
|
||||
if (aV.ShapeType() != TopAbs_VERTEX)
|
||||
const TopoDS_Shape& aS = theMSInv(i);
|
||||
// edge case
|
||||
if (theSSInterfs)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//
|
||||
TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek (aV);
|
||||
if (!pLVE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aIt.Initialize (*pLVE);
|
||||
for (; aIt.More(); aIt.Next())
|
||||
{
|
||||
const TopoDS_Shape& aE = aIt.Value();
|
||||
//
|
||||
aExp.Init (aE, TopAbs_VERTEX);
|
||||
for (; aExp.More(); aExp.Next())
|
||||
if (const TopTools_ListOfShape* pLV = theSSInterfs->Seek (aS))
|
||||
{
|
||||
const TopoDS_Shape& aV1 = aExp.Current();
|
||||
if (!theVertsToAvoid.Contains (aV1) && aMFence.Add (aV1))
|
||||
// Add vertices from intersection info to trim section edges of artificial faces
|
||||
for (TopTools_ListOfShape::Iterator itLV (*pLV); itLV.More(); itLV.Next())
|
||||
{
|
||||
aLArgs.Append (aV1);
|
||||
if (itLV.Value().ShapeType() == TopAbs_VERTEX)
|
||||
{
|
||||
aLArgs.Append (itLV.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vertex case
|
||||
if (const TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek(aS))
|
||||
{
|
||||
aIt.Initialize(*pLVE);
|
||||
for (; aIt.More(); aIt.Next())
|
||||
{
|
||||
const TopoDS_Shape& aE = aIt.Value();
|
||||
//
|
||||
aExp.Init(aE, TopAbs_VERTEX);
|
||||
for (; aExp.More(); aExp.Next())
|
||||
{
|
||||
const TopoDS_Shape& aV1 = aExp.Current();
|
||||
if (!theVertsToAvoid.Contains(aV1) && aMFence.Add(aV1))
|
||||
{
|
||||
aLArgs.Append(aV1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7137,9 +7371,19 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
|
||||
TopExp::MapShapes (aItSpIm.Value(), TopAbs_EDGE, aNewEdges);
|
||||
}
|
||||
}
|
||||
|
||||
TopoDS_Compound anInsideEdges;
|
||||
BRep_Builder().MakeCompound (anInsideEdges);
|
||||
for (Standard_Integer iE = 1; iE <= myInsideEdges.Extent(); ++iE)
|
||||
{
|
||||
BRep_Builder().Add (anInsideEdges, myInsideEdges (iE));
|
||||
}
|
||||
|
||||
//
|
||||
// Rebuild the map of edges to avoid, using the intersection results
|
||||
TopTools_IndexedMapOfShape aMEAvoid;
|
||||
TopoDS_Compound aCEAvoid;
|
||||
BRep_Builder().MakeCompound (aCEAvoid);
|
||||
// GF's data structure
|
||||
const BOPDS_PDS& pDS = aGF.PDS();
|
||||
|
||||
@@ -7175,7 +7419,7 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
|
||||
if (bKeep)
|
||||
{
|
||||
// keep the original edge
|
||||
aMEAvoid.Add (aE);
|
||||
AddToContainer (aE, aMEAvoid);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -7184,9 +7428,41 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
|
||||
{
|
||||
const TopoDS_Shape& aEIm = aItLEIm.Value();
|
||||
if (!aNewEdges.Contains (aEIm))
|
||||
aMEAvoid.Add (aEIm);
|
||||
{
|
||||
AddToContainer(aEIm, aCEAvoid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean isCut = Standard_False;
|
||||
if (aCEAvoid.NbChildren() > 0)
|
||||
{
|
||||
// Perform intersection with the small subset of the edges to make
|
||||
// it possible to use the inside edges for building new splits.
|
||||
BOPAlgo_BOP aBOP;
|
||||
aBOP.AddArgument (aCEAvoid);
|
||||
aBOP.AddTool (anInsideEdges);
|
||||
aBOP.SetOperation (BOPAlgo_CUT);
|
||||
aBOP.Perform();
|
||||
isCut = !aBOP.HasErrors();
|
||||
|
||||
if (isCut)
|
||||
{
|
||||
for (TopoDS_Iterator itCE (aCEAvoid); itCE.More(); itCE.Next())
|
||||
{
|
||||
if (!aBOP.IsDeleted (itCE.Value()))
|
||||
{
|
||||
aMEAvoid.Add (itCE.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCut)
|
||||
{
|
||||
TopExp::MapShapes (aCEAvoid, TopAbs_EDGE, aMEAvoid);
|
||||
}
|
||||
|
||||
myEdgesToAvoid = aMEAvoid;
|
||||
}
|
||||
|
||||
|
@@ -504,10 +504,9 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
|
||||
}
|
||||
aMinDist *= aMinDist;
|
||||
//Old domain
|
||||
Standard_Real t = 0.5 * (f2d + l2d);
|
||||
gp_Pnt2d aPf = C2d->Value(t);
|
||||
gp_Pnt2d aPf = C2d->Value(f2d);
|
||||
//New domain
|
||||
gp_Pnt2d aNewPf = Curve2d->Value(t);
|
||||
gp_Pnt2d aNewPf = Curve2d->Value(f2d);
|
||||
gp_Vec2d aT(aNewPf, aPf);
|
||||
if (aT.SquareMagnitude() > aMinDist)
|
||||
{
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_BinnedBuilder_Header
|
||||
#define _BVH_BinnedBuilder_Header
|
||||
#ifndef BVH_BinnedBuilder_HeaderFile
|
||||
#define BVH_BinnedBuilder_HeaderFile
|
||||
|
||||
#include <BVH_QueueBuilder.hxx>
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Box_Header
|
||||
#define _BVH_Box_Header
|
||||
#ifndef BVH_Box_HeaderFile
|
||||
#define BVH_Box_HeaderFile
|
||||
|
||||
#include <BVH_Constants.hxx>
|
||||
#include <BVH_Types.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Builder_Header
|
||||
#define _BVH_Builder_Header
|
||||
#ifndef BVH_Builder_HeaderFile
|
||||
#define BVH_Builder_HeaderFile
|
||||
|
||||
#include <BVH_Set.hxx>
|
||||
#include <BVH_BinaryTree.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Geometry_Header
|
||||
#define _BVH_Geometry_Header
|
||||
#ifndef BVH_Geometry_HeaderFile
|
||||
#define BVH_Geometry_HeaderFile
|
||||
|
||||
#include <BVH_ObjectSet.hxx>
|
||||
#include <BVH_Builder.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Object_Header
|
||||
#define _BVH_Object_Header
|
||||
#ifndef BVH_Object_HeaderFile
|
||||
#define BVH_Object_HeaderFile
|
||||
|
||||
#include <BVH_Box.hxx>
|
||||
#include <BVH_Properties.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_ObjectSet_Header
|
||||
#define _BVH_ObjectSet_Header
|
||||
#ifndef BVH_ObjectSet_HeaderFile
|
||||
#define BVH_ObjectSet_HeaderFile
|
||||
|
||||
#include <BVH_Set.hxx>
|
||||
#include <BVH_Object.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_PrimitiveSet_Header
|
||||
#define _BVH_PrimitiveSet_Header
|
||||
#ifndef BVH_PrimitiveSet_HeaderFile
|
||||
#define BVH_PrimitiveSet_HeaderFile
|
||||
|
||||
#include <BVH_Object.hxx>
|
||||
#include <BVH_Builder.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Properties_Header
|
||||
#define _BVH_Properties_Header
|
||||
#ifndef BVH_Properties_HeaderFile
|
||||
#define BVH_Properties_HeaderFile
|
||||
|
||||
#include <BVH_Box.hxx>
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Set_Header
|
||||
#define _BVH_Set_Header
|
||||
#ifndef BVH_Set_HeaderFile
|
||||
#define BVH_Set_HeaderFile
|
||||
|
||||
#include <BVH_Box.hxx>
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Sorter_Header
|
||||
#define _BVH_Sorter_Header
|
||||
#ifndef BVH_Sorter_HeaderFile
|
||||
#define BVH_Sorter_HeaderFile
|
||||
|
||||
#include <BVH_Set.hxx>
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_SpatialMedianBuilder_Header
|
||||
#define _BVH_SpatialMedianBuilder_Header
|
||||
#ifndef BVH_SpatialMedianBuilder_HeaderFile
|
||||
#define BVH_SpatialMedianBuilder_HeaderFile
|
||||
|
||||
#include <BVH_BinnedBuilder.hxx>
|
||||
#include <BVH_Box.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_SweepPlaneBuilder_Header
|
||||
#define _BVH_SweepPlaneBuilder_Header
|
||||
#ifndef BVH_SweepPlaneBuilder_HeaderFile
|
||||
#define BVH_SweepPlaneBuilder_HeaderFile
|
||||
|
||||
#include <BVH_QueueBuilder.hxx>
|
||||
#include <BVH_QuickSorter.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Triangulation_Header
|
||||
#define _BVH_Triangulation_Header
|
||||
#ifndef BVH_Triangulation_HeaderFile
|
||||
#define BVH_Triangulation_HeaderFile
|
||||
|
||||
#include <BVH_PrimitiveSet.hxx>
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BVH_Types_Header
|
||||
#define _BVH_Types_Header
|
||||
#ifndef BVH_Types_HeaderFile
|
||||
#define BVH_Types_HeaderFile
|
||||
|
||||
// Use this macro to switch between STL and OCCT vector types
|
||||
#define _BVH_USE_STD_VECTOR_
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef BinLDrivers_VectorOfDocumentSection_H
|
||||
#define BinLDrivers_VectorOfDocumentSection_H
|
||||
#ifndef BinLDrivers_VectorOfDocumentSection_HeaderFile
|
||||
#define BinLDrivers_VectorOfDocumentSection_HeaderFile
|
||||
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <BinLDrivers_DocumentSection.hxx>
|
||||
|
@@ -132,7 +132,7 @@ static int TranslateFrom (const BinObjMgt_Persistent& theSource,
|
||||
TopAbs_Orientation anOrient = CharToOrientation (aCharOrient);
|
||||
|
||||
theResult.TShape (theShapeSet->Shape (aShapeID).TShape());//TShape
|
||||
theResult.Location (theShapeSet->Locations().Location (aLocID)); //Location
|
||||
theResult.Location (theShapeSet->Locations().Location (aLocID), Standard_False); //Location
|
||||
theResult.Orientation (anOrient);//Orientation
|
||||
return 0;
|
||||
}
|
||||
|
@@ -89,139 +89,173 @@ static void D22d(const Standard_Address C, const Standard_Real U,
|
||||
void CPnts_UniformDeflection::Perform()
|
||||
{
|
||||
gp_Pnt P, P1, P2;
|
||||
// gp_Vec V1, V2, VV1, VV2, VV;
|
||||
gp_Vec V1, V2, VV;
|
||||
Standard_Real Un1;
|
||||
Standard_Real NormD1, NormD2;
|
||||
|
||||
myIPoint = -1;
|
||||
myNbPoints = -1;
|
||||
|
||||
while ( (myNbPoints<2) && (!myFinish) ) {
|
||||
|
||||
myNbPoints = myNbPoints + 1;
|
||||
|
||||
const Standard_Real anEspilon = Epsilon(myFirstParam);
|
||||
|
||||
while ( (myNbPoints<2) && (!myFinish) )
|
||||
{
|
||||
++myNbPoints;
|
||||
myParams[myNbPoints] = myFirstParam;
|
||||
|
||||
if (my3d)
|
||||
{
|
||||
D23d(myCurve, myFirstParam, myPoints[myNbPoints], V1, V2);
|
||||
}
|
||||
else
|
||||
{
|
||||
D22d(myCurve, myFirstParam, myPoints[myNbPoints], V1, V2);
|
||||
P = myPoints[myNbPoints] ;
|
||||
}
|
||||
P = myPoints[myNbPoints];
|
||||
NormD1 = V1.Magnitude();
|
||||
if (NormD1 < myTolCur || V2.Magnitude() < myTolCur) {
|
||||
if (NormD1 < myTolCur || V2.Magnitude() < myTolCur)
|
||||
{
|
||||
// singularity on the tangent or null curvature
|
||||
myDu = Min(myDwmax, 1.5 * myDu);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
NormD2 = V2.CrossMagnitude(V1);
|
||||
if (NormD2 / NormD1 < myDeflection) { // collinearity of derivatives
|
||||
myDu = Min(myDwmax, 1.5 * myDu);
|
||||
if (NormD2 / NormD1 < myDeflection)
|
||||
{
|
||||
// collinearity of derivatives
|
||||
myDu = Min(myDwmax, 1.5 * myDu);
|
||||
}
|
||||
else {
|
||||
myDu = Sqrt(8.* myDeflection * NormD1 / NormD2 );
|
||||
myDu = Min(Max(myDu, myTolCur), myDwmax);
|
||||
else
|
||||
{
|
||||
myDu = Sqrt(8.* myDeflection * NormD1 / NormD2);
|
||||
myDu = Min(Max(myDu, myTolCur), myDwmax);
|
||||
}
|
||||
}
|
||||
|
||||
// check if the arrow is observed if WithControl
|
||||
|
||||
if (myControl) {
|
||||
if (myControl)
|
||||
{
|
||||
myDu = Min(myDu, myLastParam-myFirstParam);
|
||||
if (my3d) {
|
||||
|
||||
D03d(myCurve, myFirstParam + myDu,P);
|
||||
D03d(myCurve, myFirstParam + (myDu / 2.0),P1);
|
||||
if (my3d)
|
||||
{
|
||||
D03d(myCurve, myFirstParam + myDu,P);
|
||||
D03d(myCurve, myFirstParam + (myDu / 2.0), P1);
|
||||
}
|
||||
else {
|
||||
|
||||
D02d(myCurve, myFirstParam + myDu,P);
|
||||
D02d(myCurve, myFirstParam + (myDu / 2.0),P1);
|
||||
else
|
||||
{
|
||||
D02d(myCurve, myFirstParam + myDu,P);
|
||||
D02d(myCurve, myFirstParam + (myDu / 2.0), P1);
|
||||
}
|
||||
V1= gp_Vec(myPoints[myNbPoints], P);
|
||||
NormD1 = V1.Magnitude();
|
||||
if (NormD1 >= myDeflection) {
|
||||
V2 = gp_Vec(myPoints[myNbPoints], P1);
|
||||
NormD2 = V2.CrossMagnitude(V1) / NormD1;
|
||||
|
||||
// passing of arrow starting from which the redivision is done is arbitrary
|
||||
// probably it will be necessary to readjust it (differentiate the first point
|
||||
// from the others) this test does not work on the points of inflexion
|
||||
|
||||
if (NormD2 > myDeflection / 5.0) {
|
||||
NormD2 = Max(NormD2, 1.1 * myDeflection);
|
||||
myDu = myDu * Sqrt(myDeflection / NormD2);
|
||||
myDu = Min(Max(myDu, myTolCur), myDwmax);
|
||||
}
|
||||
if (NormD1 >= myDeflection)
|
||||
{
|
||||
V2 = gp_Vec(myPoints[myNbPoints], P1);
|
||||
NormD2 = V2.CrossMagnitude(V1) / NormD1;
|
||||
|
||||
// passing of arrow starting from which the redivision is done is arbitrary
|
||||
// probably it will be necessary to readjust it (differentiate the first point
|
||||
// from the others) this test does not work on the points of inflexion
|
||||
if (NormD2 > myDeflection / 5.0)
|
||||
{
|
||||
NormD2 = Max(NormD2, 1.1 * myDeflection);
|
||||
myDu = myDu * Sqrt(myDeflection / NormD2);
|
||||
myDu = Min(Max(myDu, myTolCur), myDwmax);
|
||||
}
|
||||
}
|
||||
}
|
||||
myFirstParam = myFirstParam + myDu;
|
||||
myFinish = (myLastParam - myFirstParam < myTolCur) || (myDu == 0.);
|
||||
myFirstParam += myDu;
|
||||
myFinish = myLastParam - myFirstParam < myTolCur ||
|
||||
Abs(myDu) < myTolCur ||
|
||||
// to avoid less than double precision endless increment
|
||||
myDu < anEspilon;
|
||||
}
|
||||
if (myFinish) {
|
||||
if (myFinish)
|
||||
{
|
||||
// the last point is corrected if control
|
||||
if (myControl && (myNbPoints == 1) ) {
|
||||
if (myControl && (myNbPoints == 1) )
|
||||
{
|
||||
Un1 = myParams[0];
|
||||
if (myLastParam - Un1 < 0.33*(myLastParam-myFirstParam)) {
|
||||
myFirstParam = (myLastParam + Un1) / 2.0;
|
||||
myParams[0]= myFirstParam;
|
||||
myParams[1]= myLastParam;
|
||||
if (my3d) {
|
||||
D03d(myCurve, myParams[0], myPoints[0]);
|
||||
D03d(myCurve, myParams[1], myPoints[1]);
|
||||
}
|
||||
else {
|
||||
D02d(myCurve, myParams[0], myPoints[0]);
|
||||
if (myLastParam - Un1 < 0.33*(myLastParam-myFirstParam))
|
||||
{
|
||||
myFirstParam = (myLastParam + Un1) / 2.0;
|
||||
myParams[0] = myFirstParam;
|
||||
myParams[1] = myLastParam;
|
||||
if (my3d)
|
||||
{
|
||||
D03d(myCurve, myParams[0], myPoints[0]);
|
||||
D03d(myCurve, myParams[1], myPoints[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
D02d(myCurve, myParams[0], myPoints[0]);
|
||||
D02d(myCurve, myParams[1], myPoints[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (my3d) {
|
||||
D23d(myCurve, myLastParam, P1, V1, V2);
|
||||
}
|
||||
else {
|
||||
D22d(myCurve, myLastParam, P1, V1, V2);
|
||||
}
|
||||
P = myPoints[0] ;
|
||||
VV = gp_Vec(P1, P);
|
||||
NormD1 = VV.Magnitude();
|
||||
if ( NormD1 < myDeflection) {
|
||||
myParams[1]= myLastParam;
|
||||
myPoints[1]= P1 ;
|
||||
}
|
||||
else {
|
||||
myFirstParam = (myLastParam * (myParams[1] - Un1) + Un1 * myDu)
|
||||
/(myFirstParam -Un1);
|
||||
if (my3d)
|
||||
D03d(myCurve, myFirstParam, P2);
|
||||
else
|
||||
D02d(myCurve, myFirstParam, P2);
|
||||
|
||||
if ((VV.CrossMagnitude(gp_Vec(P2, P)) / NormD1 < myDeflection) &&
|
||||
(Un1 >= myLastParam - myDwmax) ) {
|
||||
// point n is removed
|
||||
myParams[1]= myLastParam;
|
||||
myPoints[1] = P1 ;
|
||||
}
|
||||
else {
|
||||
myParams[1]=myFirstParam;
|
||||
myPoints[1] = P2 ;
|
||||
myParams[2]=myLastParam;
|
||||
myPoints[2] = P1 ;
|
||||
myNbPoints = myNbPoints +1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (my3d)
|
||||
{
|
||||
D23d(myCurve, myLastParam, P1, V1, V2);
|
||||
}
|
||||
else
|
||||
{
|
||||
D22d(myCurve, myLastParam, P1, V1, V2);
|
||||
}
|
||||
P = myPoints[0];
|
||||
VV = gp_Vec(P1, P);
|
||||
NormD1 = VV.Magnitude();
|
||||
if (NormD1 < myDeflection)
|
||||
{
|
||||
myParams[1] = myLastParam;
|
||||
myPoints[1] = P1;
|
||||
}
|
||||
else
|
||||
{
|
||||
myFirstParam = (myLastParam * (myParams[1] - Un1) + Un1 * myDu) / (myFirstParam - Un1);
|
||||
if (my3d)
|
||||
{
|
||||
D03d(myCurve, myFirstParam, P2);
|
||||
}
|
||||
else
|
||||
{
|
||||
D02d(myCurve, myFirstParam, P2);
|
||||
}
|
||||
if ((VV.CrossMagnitude(gp_Vec(P2, P)) / NormD1 < myDeflection) &&
|
||||
(Un1 >= myLastParam - myDwmax) )
|
||||
{
|
||||
// point n is removed
|
||||
myParams[1] = myLastParam;
|
||||
myPoints[1] = P1;
|
||||
}
|
||||
else
|
||||
{
|
||||
myParams[1] = myFirstParam;
|
||||
myPoints[1] = P2;
|
||||
myParams[2] = myLastParam;
|
||||
myPoints[2] = P1;
|
||||
++myNbPoints;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
myNbPoints = myNbPoints +1 ;
|
||||
if (myNbPoints >= 3) myNbPoints = 2;
|
||||
myParams[myNbPoints]= myLastParam;
|
||||
if (my3d) {
|
||||
D03d(myCurve, myLastParam, myPoints[myNbPoints]);
|
||||
}
|
||||
else {
|
||||
D02d(myCurve, myLastParam, myPoints[myNbPoints]);
|
||||
}
|
||||
else
|
||||
{
|
||||
++myNbPoints;
|
||||
if (myNbPoints >= 3)
|
||||
{
|
||||
myNbPoints = 2;
|
||||
}
|
||||
myParams[myNbPoints] = myLastParam;
|
||||
if (my3d)
|
||||
{
|
||||
D03d(myCurve, myLastParam, myPoints[myNbPoints]);
|
||||
}
|
||||
else
|
||||
{
|
||||
D02d(myCurve, myLastParam, myPoints[myNbPoints]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _ANAFILLETALGO_H_
|
||||
#define _ANAFILLETALGO_H_
|
||||
#ifndef ChFi2d_AnaFilletAlgo_HeaderFile
|
||||
#define ChFi2d_AnaFilletAlgo_HeaderFile
|
||||
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _CHAMFERAPI_H_
|
||||
#define _CHAMFERAPI_H_
|
||||
#ifndef ChFi2d_ChamferAPI_HeaderFile
|
||||
#define ChFi2d_ChamferAPI_HeaderFile
|
||||
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _CHFI2D_FILLETAPI_H_
|
||||
#define _CHFI2D_FILLETAPI_H_
|
||||
#ifndef ChFi2d_FilletAPI_HeaderFile
|
||||
#define ChFi2d_FilletAPI_HeaderFile
|
||||
|
||||
#include <ChFi2d_FilletAlgo.hxx>
|
||||
#include <ChFi2d_AnaFilletAlgo.hxx>
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _FILLETALGO_H_
|
||||
#define _FILLETALGO_H_
|
||||
#ifndef ChFi2d_FilletAlgo_HeaderFile
|
||||
#define ChFi2d_FilletAlgo_HeaderFile
|
||||
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
@@ -139,12 +139,12 @@ ChFiDS_TypeOfConcavity ChFi3d::DefineConnectType(const TopoDS_Edge& E,
|
||||
//function : IsTangentFaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape Order)
|
||||
Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape theOrder)
|
||||
{
|
||||
if (Order == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
|
||||
if (theOrder == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0)
|
||||
return Standard_True;
|
||||
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
@@ -152,15 +152,46 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
EE.Reverse();
|
||||
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
||||
(EE, theFace2, aFirst, aLast);
|
||||
Handle(Geom2d_Curve) aC2d1, aC2d2;
|
||||
|
||||
if (!theFace1.IsSame (theFace2) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace1) &&
|
||||
BRep_Tool::IsClosed (theEdge, theFace2))
|
||||
{
|
||||
//Find the edge in the face 1: this edge will have correct orientation
|
||||
TopoDS_Edge anEdgeInFace1;
|
||||
TopoDS_Face aFace1 = theFace1;
|
||||
aFace1.Orientation (TopAbs_FORWARD);
|
||||
TopExp_Explorer anExplo (aFace1, TopAbs_EDGE);
|
||||
for (; anExplo.More(); anExplo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
|
||||
if (anEdge.IsSame (theEdge))
|
||||
{
|
||||
anEdgeInFace1 = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (anEdgeInFace1.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
aC2d1 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace1, aFirst, aLast);
|
||||
TopoDS_Face aFace2 = theFace2;
|
||||
aFace2.Orientation (TopAbs_FORWARD);
|
||||
anEdgeInFace1.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface (anEdgeInFace1, aFace2, aFirst, aLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
aC2d1 = BRep_Tool::CurveOnSurface (theEdge, theFace1, aFirst, aLast);
|
||||
//For the case of seam edge
|
||||
TopoDS_Edge EE = theEdge;
|
||||
if (theFace1.IsSame(theFace2))
|
||||
EE.Reverse();
|
||||
aC2d2 = BRep_Tool::CurveOnSurface (EE, theFace2, aFirst, aLast);
|
||||
}
|
||||
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
@@ -191,15 +222,19 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, Order,
|
||||
aSurf1, aSurf2, theOrder,
|
||||
0.001, TolC0, 0.1, 0.1, 0.1);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
if (theOrder == GeomAbs_C2 &&
|
||||
aCont.StatusError() == LocalAnalysis_NullSecondDerivative)
|
||||
continue;
|
||||
|
||||
nbNotDone++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Order == GeomAbs_G1)
|
||||
if (theOrder == GeomAbs_G1)
|
||||
{
|
||||
if (!aCont.IsG1())
|
||||
return Standard_False;
|
||||
|
@@ -819,10 +819,13 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS1() == fd2->IndexOfS1()) {
|
||||
jf1 = 1; jf2 = 1;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation. This would raise problems
|
||||
@@ -840,10 +843,13 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS2() == fd2->IndexOfS1()) {
|
||||
jf1 = 2; jf2 = 1;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation. This would raise problems
|
||||
@@ -873,10 +879,13 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS1() == fd2->IndexOfS2()) {
|
||||
jf1 = 1; jf2 = 2;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation.
|
||||
@@ -906,10 +915,13 @@ Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
if(fd1->IndexOfS2() == fd2->IndexOfS2()) {
|
||||
jf1 = 2; jf2 = 2;
|
||||
face = TopoDS::Face(DStr.Shape(fd1->Index(jf1)));
|
||||
if (face.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL face");
|
||||
OrSave1 = cd1->Orientation(jf1);
|
||||
Or = OrFace1 = face.Orientation();
|
||||
OrSave2 = cd2->Orientation(jf2);
|
||||
OrFace2 = DStr.Shape(fd2->Index(jf2)).Orientation();
|
||||
const TopoDS_Shape& shape2 = DStr.Shape(fd2->Index(jf2));
|
||||
if (shape2.IsNull()) throw Standard_NullObject("ChFi3d_IsInFront : Trying to check orientation of NULL shape");
|
||||
OrFace2 = shape2.Orientation();
|
||||
visavis = Standard_True;
|
||||
sameside = ChFi3d::SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2);
|
||||
// The parameters of the other side are not used for orientation.
|
||||
|
@@ -1684,6 +1684,13 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
|
||||
}
|
||||
if (compoint1 && compoint2) {
|
||||
SeqFil.Remove(num);
|
||||
num = ChFi3d_IndexOfSurfData(Vtx,stripe,sens);
|
||||
if (isfirst) {
|
||||
num1=num+1;
|
||||
}
|
||||
else {
|
||||
num1=num-1;
|
||||
}
|
||||
reg1=Standard_False; reg2=Standard_False;
|
||||
}
|
||||
}
|
||||
@@ -2036,6 +2043,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
|
||||
if ((possible1 && possible2) || (!possible1 && !possible2) || (nbarete > 4)) {
|
||||
while (!trouve) {
|
||||
nb++;
|
||||
if (nb>=nn) throw Standard_Failure("IntersectionAtEnd : the max number of faces reached");
|
||||
if (nb!=1) F3=Face[nb-2];
|
||||
Face[nb-1]=F3;
|
||||
if (CV1.Arc().IsSame(edgelibre1))
|
||||
@@ -2153,6 +2161,9 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
|
||||
F=Face[nb-1];
|
||||
if (!prolface[nb-1]) faceprol[nb-1]=F;
|
||||
}
|
||||
|
||||
if (F.IsNull()) throw Standard_NullObject("IntersectionAtEnd : Trying to intersect with NULL face");
|
||||
|
||||
Sfacemoins1=BRep_Tool::Surface(F);
|
||||
Handle(Geom_Curve) cint;
|
||||
Handle(Geom2d_Curve) C2dint1, C2dint2,cface,cfacemoins1;
|
||||
|
@@ -14,15 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef ChFiKPart_ComputeData_CS_HeaderFile
|
||||
#define ChFiKPart_ComputeData_CS_HeaderFile
|
||||
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
|
||||
#ifndef ChFiKPart_ComputeData_CS_HeaderFile
|
||||
#define ChFiKPart_ComputeData_CS_HeaderFile
|
||||
|
||||
|
||||
void ChFiKPart_CornerSpine(const Handle(Adaptor3d_Surface)& S1,
|
||||
const Handle(Adaptor3d_Surface)& S2,
|
||||
const gp_Pnt2d& P1S1,
|
||||
|
@@ -14,8 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef ChFiKPart_ComputeData_PlnCon_HeaderFile
|
||||
#define ChFiKPart_ComputeData_PlnCon_HeaderFile
|
||||
#ifndef ChFiKPart_ComputeData_FilPlnCon_HeaderFile
|
||||
#define ChFiKPart_ComputeData_FilPlnCon_HeaderFile
|
||||
|
||||
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_SurfData)& Data,
|
||||
|
@@ -14,8 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef ChFiKPart_ComputeData_PlnCyl_HeaderFile
|
||||
#define ChFiKPart_ComputeData_PlnCyl_HeaderFile
|
||||
#ifndef ChFiKPart_ComputeData_FilPlnCyl_HeaderFile
|
||||
#define ChFiKPart_ComputeData_FilPlnCyl_HeaderFile
|
||||
|
||||
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_SurfData)& Data,
|
||||
|
@@ -14,8 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef ChFiKPart_ComputeData_PlnPln_HeaderFile
|
||||
#define ChFiKPart_ComputeData_PlnPln_HeaderFile
|
||||
#ifndef ChFiKPart_ComputeData_FilPlnPln_HeaderFile
|
||||
#define ChFiKPart_ComputeData_FilPlnPln_HeaderFile
|
||||
|
||||
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_SurfData)& Data,
|
||||
|
@@ -11,8 +11,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef __Cocoa_LocalPool_h_
|
||||
#define __Cocoa_LocalPool_h_
|
||||
#ifndef Cocoa_LocalPool_HeaderFile
|
||||
#define Cocoa_LocalPool_HeaderFile
|
||||
|
||||
#if defined(__clang__) && (__clang_major__ >= 4)
|
||||
#if __has_feature(objc_arc)
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Cocoa_Window_H__
|
||||
#define _Cocoa_Window_H__
|
||||
#ifndef Cocoa_Window_HeaderFile
|
||||
#define Cocoa_Window_HeaderFile
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#import <TargetConditionals.h>
|
||||
|
@@ -436,15 +436,6 @@ void Cocoa_Window::InvalidateContent (const Handle(Aspect_DisplayConnection)& )
|
||||
return;
|
||||
}
|
||||
|
||||
if ([NSThread isMainThread])
|
||||
{
|
||||
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
[myHView setNeedsDisplay];
|
||||
#else
|
||||
[myHView setNeedsDisplay: YES];
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
[myHView performSelectorOnMainThread: @selector(invalidateContentOcct:)
|
||||
withObject: NULL
|
||||
|
@@ -14,13 +14,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef Convert_CosAndSinEvalFunction_HeaderFile
|
||||
#define Convert_CosAndSinEvalFunction_HeaderFile
|
||||
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
#ifndef _Convert_CosAnSinEvalFunction_HeaderFile
|
||||
#define _Convert_CosAnSinEvalFunction_HeaderFile
|
||||
|
||||
typedef void Convert_CosAndSinEvalFunction(Standard_Real,
|
||||
const Standard_Integer,
|
||||
const TColgp_Array1OfPnt2d&,
|
||||
|
@@ -14,12 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef Convert_PolynomialCosAndSin_HeaderFile
|
||||
#define Convert_PolynomialCosAndSin_HeaderFile
|
||||
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
|
||||
#ifndef _Convert_PolynomialCosAnSin_HeaderFile
|
||||
#define _Convert_PolynomialCosAnSin_HeaderFile
|
||||
|
||||
void BuildPolynomialCosAndSin
|
||||
(const Standard_Real,
|
||||
const Standard_Real,
|
||||
|
@@ -11,8 +11,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _DsgPrs_DatumPrs_H__
|
||||
#define _DsgPrs_DatumPrs_H__
|
||||
#ifndef DsgPrs_DatumPrs_HeaderFile
|
||||
#define DsgPrs_DatumPrs_HeaderFile
|
||||
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
@@ -610,6 +610,9 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
const Bnd_Range aRange(theUt21, theUt22);
|
||||
Bnd_Range aProjRng1;
|
||||
|
||||
// Precision of the calculation depends on circles radii
|
||||
const Standard_Real aPrecision = Max(Epsilon(myC[0]->Circle().Radius()), Epsilon(myC[1]->Circle().Radius()));
|
||||
|
||||
// Project arc of the 1st circle between points theUt11 and theUt12 to the
|
||||
// 2nd circle. It is necessary to chose correct arc from two possible ones.
|
||||
|
||||
@@ -671,7 +674,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
// myIsParallel = TRUE and only the least distance will be returned.
|
||||
//4. Arcs are not parallel. Then several (or single) extremas will be returned.
|
||||
|
||||
if (aRng.Delta() > Precision::Angular())
|
||||
if (aRng.Delta() > Precision::Confusion())
|
||||
{
|
||||
Standard_Real aPar = 0.0;
|
||||
aRng.GetIntermediatePoint(0.5, aPar);
|
||||
@@ -686,7 +689,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
aMinSqD = Min(aMinSqD, ExtPCir.SquareDistance(anExtID));
|
||||
}
|
||||
|
||||
if (aMinSqD <= aMinSquareDist + 10.* Epsilon(1. + aMinSqD))
|
||||
if (aMinSqD <= aMinSquareDist + (1. + aMinSqD) * aPrecision)
|
||||
{
|
||||
ClearSolutions();
|
||||
mySqDist.Append(aMinSqD);
|
||||
@@ -711,7 +714,6 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Nearer solution can be found
|
||||
}
|
||||
else if (!aRng.IsVoid())
|
||||
@@ -787,7 +789,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
||||
imin = k;
|
||||
}
|
||||
}
|
||||
if (aDmin <= aMinSquareDist + 10.* Epsilon(1. + aDmin))
|
||||
if (aDmin <= aMinSquareDist + (1. + aDmin) * aPrecision)
|
||||
{
|
||||
if (imin == 0)
|
||||
{
|
||||
|
@@ -163,7 +163,6 @@ static Standard_Real ProjPOnC(const Pnt& theP,
|
||||
if (aD < aDist)
|
||||
aDist = aD;
|
||||
}
|
||||
aDist = sqrt(aDist);
|
||||
}
|
||||
return aDist;
|
||||
}
|
||||
@@ -340,10 +339,20 @@ void Extrema_GenExtCC::Perform()
|
||||
aNbInter[1] = anIntervals2->Length() - 1;
|
||||
}
|
||||
}
|
||||
if (C1.IsClosed() && aNbInter[0] == 1)
|
||||
{
|
||||
ChangeIntervals(anIntervals1, 3);
|
||||
aNbInter[0] = anIntervals1->Length() - 1;
|
||||
}
|
||||
if (C2.IsClosed() && aNbInter[1] == 1)
|
||||
{
|
||||
ChangeIntervals(anIntervals2, 3);
|
||||
aNbInter[1] = anIntervals2->Length() - 1;
|
||||
}
|
||||
|
||||
// Lipchitz constant computation.
|
||||
const Standard_Real aMaxLC = 10000.;
|
||||
Standard_Real aLC = 9.0; // Default value.
|
||||
Standard_Real aLC = 100.0; // Default value.
|
||||
const Standard_Real aMaxDer1 = 1.0 / C1.Resolution(1.0);
|
||||
const Standard_Real aMaxDer2 = 1.0 / C2.Resolution(1.0);
|
||||
Standard_Real aMaxDer = Max(aMaxDer1, aMaxDer2) * Sqrt(2.0);
|
||||
@@ -383,6 +392,43 @@ void Extrema_GenExtCC::Perform()
|
||||
}
|
||||
|
||||
Extrema_GlobOptFuncCCC2 aFunc (C1, C2);
|
||||
if (aLC < aMaxLC || aMaxDer > aMaxLC)
|
||||
{
|
||||
//Estimation of Lipschitz constant by gradient of optimization function
|
||||
//using sampling in parameter space.
|
||||
math_Vector aT(1, 2), aG(1, 2);
|
||||
Standard_Real aF, aMaxG = 0.;
|
||||
Standard_Real t1, t2, dt1, dt2;
|
||||
Standard_Integer n1 = 21, n2 = 21, i1, i2;
|
||||
dt1 = (C1.LastParameter() - C1.FirstParameter()) / (n1 - 1);
|
||||
dt2 = (C2.LastParameter() - C2.FirstParameter()) / (n2 - 1);
|
||||
for (i1 = 1, t1 = C1.FirstParameter(); i1 <= n1; ++i1, t1 += dt1)
|
||||
{
|
||||
aT(1) = t1;
|
||||
for (i2 = 1, t2 = C2.FirstParameter(); i2 <= n2; ++i2, t2 += dt2)
|
||||
{
|
||||
aT(2) = t2;
|
||||
aFunc.Values(aT, aF, aG);
|
||||
Standard_Real aMod = aG(1)*aG(1) + aG(2)*aG(2);
|
||||
aMaxG = Max(aMaxG, aMod);
|
||||
}
|
||||
}
|
||||
aMaxG = Sqrt(aMaxG);
|
||||
if (aMaxG > aMaxDer)
|
||||
{
|
||||
aLC = Min(aMaxG, aMaxLC);
|
||||
isConstLockedFlag = Standard_True;
|
||||
}
|
||||
if (aMaxG > 100. * aMaxLC)
|
||||
{
|
||||
aLC = 100. * aMaxLC;
|
||||
isConstLockedFlag = Standard_True;
|
||||
}
|
||||
else if (aMaxG < 0.1 * aMaxDer)
|
||||
{
|
||||
isConstLockedFlag = Standard_True;
|
||||
}
|
||||
}
|
||||
math_GlobOptMin aFinder(&aFunc, myLowBorder, myUppBorder, aLC);
|
||||
aFinder.SetLipConstState(isConstLockedFlag);
|
||||
aFinder.SetContinuity(aContinuity == GeomAbs_C2 ? 2 : 1);
|
||||
@@ -518,7 +564,6 @@ void Extrema_GenExtCC::Perform()
|
||||
aVec(2) = (aCurrent.Y() + aNext.Y()) * 0.5;
|
||||
|
||||
aFunc.Value(aVec, aVal);
|
||||
|
||||
if (Abs(aVal - aF) < Precision::Confusion())
|
||||
{
|
||||
// It seems the parallel segment is found.
|
||||
|
@@ -45,7 +45,7 @@ static Standard_Boolean _Value(const Adaptor3d_Curve& C1,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
F = C2.Value(v).Distance(C1.Value(u));
|
||||
F = C2.Value(v).SquareDistance(C1.Value(u));
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ static Standard_Boolean _Value(const Adaptor2d_Curve2d& C1,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
F = C2.Value(v).Distance(C1.Value(u));
|
||||
F = C2.Value(v).SquareDistance(C1.Value(u));
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -91,13 +91,14 @@ static Standard_Boolean _Gradient(const Adaptor3d_Curve& C1,
|
||||
|
||||
C1.D1(X(1), C1D0, C1D1);
|
||||
C2.D1(X(2), C2D0, C2D1);
|
||||
|
||||
|
||||
G(1) = - (C2D0.X() - C1D0.X()) * C1D1.X()
|
||||
- (C2D0.Y() - C1D0.Y()) * C1D1.Y()
|
||||
- (C2D0.Z() - C1D0.Z()) * C1D1.Z();
|
||||
G(2) = (C2D0.X() - C1D0.X()) * C2D1.X()
|
||||
+ (C2D0.Y() - C1D0.Y()) * C2D1.Y()
|
||||
+ (C2D0.Z() - C1D0.Z()) * C2D1.Z();
|
||||
G *= 2.;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -123,8 +124,11 @@ static Standard_Boolean _Gradient(const Adaptor2d_Curve2d& C1,
|
||||
|
||||
G(1) = - (C2D0.X() - C1D0.X()) * C1D1.X()
|
||||
- (C2D0.Y() - C1D0.Y()) * C1D1.Y();
|
||||
|
||||
G(2) = (C2D0.X() - C1D0.X()) * C2D1.X()
|
||||
+ (C2D0.Y() - C1D0.Y()) * C2D1.Y();
|
||||
G *= 2.;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -168,6 +172,7 @@ static Standard_Boolean _Hessian (const Adaptor3d_Curve& C1,
|
||||
+ (C2D0.X() - C1D0.X()) * C2D2.X()
|
||||
+ (C2D0.Y() - C1D0.Y()) * C2D2.Y()
|
||||
+ (C2D0.Z() - C1D0.Z()) * C2D2.Z();
|
||||
H *= 2.;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -206,10 +211,11 @@ static Standard_Boolean _Hessian (const Adaptor2d_Curve2d& C1,
|
||||
+ C2D1.Y() * C2D1.Y()
|
||||
+ (C2D0.X() - C1D0.X()) * C2D2.X()
|
||||
+ (C2D0.Y() - C1D0.Y()) * C2D2.Y();
|
||||
H *= 2.;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
// C0
|
||||
//C0
|
||||
|
||||
//=======================================================================
|
||||
//function : Extrema_GlobOptFuncCCC0
|
||||
@@ -417,6 +423,5 @@ Standard_Boolean Extrema_GlobOptFuncCCC2::Values(const math_Vector& X,Standard_R
|
||||
else
|
||||
isHessianComputed = _Hessian(*myC1_2d, *myC2_2d, X, H);
|
||||
|
||||
|
||||
return (Value(X, F) && Gradient(X, G) && isHessianComputed);
|
||||
}
|
||||
|
@@ -12,8 +12,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Font_BRepFont_H__
|
||||
#define _Font_BRepFont_H__
|
||||
#ifndef Font_BRepFont_HeaderFile
|
||||
#define Font_BRepFont_HeaderFile
|
||||
|
||||
#include <StdPrs_BRepFont.hxx>
|
||||
|
||||
|
@@ -103,9 +103,11 @@ bool Font_FTFont::Init (const Handle(NCollection_Buffer)& theData,
|
||||
{
|
||||
throw Standard_ProgramError ("Font_FTFont, Light and Normal hinting styles are mutually exclusive");
|
||||
}
|
||||
#ifdef HAVE_FREETYPE
|
||||
setLoadFlag (FT_LOAD_TARGET_LIGHT, (theParams.FontHinting & Font_Hinting_Light) != 0);
|
||||
setLoadFlag (FT_LOAD_NO_HINTING, (theParams.FontHinting & Font_Hinting_Normal) == 0
|
||||
&& (theParams.FontHinting & Font_Hinting_Light) == 0);
|
||||
#endif
|
||||
|
||||
// manage native / autohinting
|
||||
if ((theParams.FontHinting & Font_Hinting_ForceAutohint) != 0
|
||||
@@ -113,8 +115,10 @@ bool Font_FTFont::Init (const Handle(NCollection_Buffer)& theData,
|
||||
{
|
||||
throw Standard_ProgramError ("Font_FTFont, ForceAutohint and NoAutohint are mutually exclusive");
|
||||
}
|
||||
#ifdef HAVE_FREETYPE
|
||||
setLoadFlag (FT_LOAD_FORCE_AUTOHINT, (theParams.FontHinting & Font_Hinting_ForceAutohint) != 0);
|
||||
setLoadFlag (FT_LOAD_NO_AUTOHINT, (theParams.FontHinting & Font_Hinting_NoAutohint) != 0);
|
||||
#endif
|
||||
|
||||
if (!myFTLib->IsValid())
|
||||
{
|
||||
|