@section occt_modalg_1 Introduction
-This manual explains how to use the Modeling Algorithms. It provides basic documentation on modeling algorithms. For advanced information on Modeling Algorithms, see our offerings on our web site at <a href="http://www.opencascade.org/support/training/">www.opencascade.org/support/training/</a>
+This manual explains how to use the Modeling Algorithms. It provides basic documentation on modeling algorithms. For advanced information on Modeling Algorithms, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
The Modeling Algorithms module brings together a wide range of topological algorithms used in modeling. Along with these tools, you will find the geometric algorithms, which they call.
This technique of qualification of a solution, in relation to the curves to which
it is tangential, can be used in all algorithms for constructing a circle or a straight
line by geometric constraints. Four qualifiers are used:
- * **Enclosing** - the solution(s) must enclose the argument;
- * **Enclosed** - the solution(s) must be enclosed by the argument;
- * **Outside** - the solution(s) and the argument must be external to one another;
- * **Unqualified** - the relative position is not qualified, i.e. all solutions apply.
+ * **Enclosing** -- the solution(s) must enclose the argument;
+ * **Enclosed** -- the solution(s) must be enclosed by the argument;
+ * **Outside** -- the solution(s) and the argument must be external to one another;
+ * **Unqualified** -- the relative position is not qualified, i.e. all solutions apply.
It is possible to create expressions using the qualifiers, for example:
~~~~~
* construction of plate surfaces
* extension of a 3D curve or surface beyond its original bounds.
-OPEN CASCADE company also provides a product known as <a href="http://www.opencascade.org/support/products/ssp/">Surfaces from Scattered Points</a>, which allows constructing surfaces from scattered points. This algorithm accepts or constructs an initial B-Spline surface and looks for its deformation (finite elements method) which would satisfy the constraints. Using optimized computation methods, this algorithm is able to construct a surface from more than 500 000 points.
+OPEN CASCADE company also provides a product known as <a href="http://www.opencascade.com/content/surfaces-scattered-points">Surfaces from Scattered Points</a>, which allows constructing surfaces from scattered points. This algorithm accepts or constructs an initial B-Spline surface and looks for its deformation (finite elements method) which would satisfy the constraints. Using optimized computation methods, this algorithm is able to construct a surface from more than 500 000 points.
SSP product is not supplied with Open CASCADE Technology, but can be purchased separately.
@subsubsection occt_modalg_2_5_4 Filling a contour
-It is often convenient to create a surface from two or more curves which will form the boundaries that define the new surface.
-This is done by the class *GeomFill_ConstrainedFilling*, which allows filling a contour defined by two, three or four curves as well as by tangency constraints. The resulting surface is a BSpline.
+It is often convenient to create a surface from some curves, which will form the boundaries that define the new surface.
+This is done by the class *GeomFill_ConstrainedFilling*, which allows filling a contour defined by three or four curves as well as by tangency constraints. The resulting surface is a BSpline.
A case in point is the intersection of two fillets at a corner. If the radius of the fillet on one edge is different from that of the fillet on another, it becomes impossible to sew together all the edges of the resulting surfaces. This leaves a gap in the overall surface of the object which you are constructing.
The enumerations *FillingStyle* specify the styles used to build the surface. These include:
- * *Stretch* - the style with the flattest patches
- * *Coons* - a rounded style with less depth than *Curved*
- * *Curved* - the style with the most rounded patches.
+ * *Stretch* -- the style with the flattest patches
+ * *Coons* -- a rounded style with less depth than *Curved*
+ * *Curved* -- the style with the most rounded patches.
@image html /user_guides/modeling_algos/images/modeling_algos_image018.png "Intersecting filleted edges with different radii leave a gap, is filled by a surface"
@image latex /user_guides/modeling_algos/images/modeling_algos_image018.png "Intersecting filleted edges with different radii leave a gap, is filled by a surface"
The *Error* method returns a term of the *BRepBuilderAPI_EdgeError* enumeration. It can be used to analyze the error when *IsDone* method returns False. The terms are:
- * **EdgeDone** - No error occurred, *IsDone* returns True.
- * **PointProjectionFailed** - No parameters were given, but the projection of the 3D points on the curve failed. This happens if the point distance to the curve is greater than the precision.
- * **ParameterOutOfRange** - The given parameters are not in the range *C->FirstParameter()*, *C->LastParameter()*
- * **DifferentPointsOnClosedCurve** - The two vertices or points have different locations but they are the extremities of a closed curve.
- * **PointWithInfiniteParameter** - A finite coordinate point was associated with an infinite parameter (see the Precision package for a definition of infinite values).
- * **DifferentsPointAndParameter** - The distance of the 3D point and the point evaluated on the curve with the parameter is greater than the precision.
- * **LineThroughIdenticPoints** - Two identical points were given to define a line (construction of an edge without curve), *gp::Resolution* is used to test confusion .
+ * **EdgeDone** -- No error occurred, *IsDone* returns True.
+ * **PointProjectionFailed** -- No parameters were given, but the projection of the 3D points on the curve failed. This happens if the point distance to the curve is greater than the precision.
+ * **ParameterOutOfRange** -- The given parameters are not in the range *C->FirstParameter()*, *C->LastParameter()*
+ * **DifferentPointsOnClosedCurve** -- The two vertices or points have different locations but they are the extremities of a closed curve.
+ * **PointWithInfiniteParameter** -- A finite coordinate point was associated with an infinite parameter (see the Precision package for a definition of infinite values).
+ * **DifferentsPointAndParameter** -- The distance of the 3D point and the point evaluated on the curve with the parameter is greater than the precision.
+ * **LineThroughIdenticPoints** -- Two identical points were given to define a line (construction of an edge without curve), *gp::Resolution* is used to test confusion .
The following example creates a rectangle centered on the origin of dimensions H, L with fillets of radius R. The edges and the vertices are stored in the arrays *theEdges* and *theVertices*. We use class *Array1OfShape* (i.e. not arrays of edges or vertices). See the image below.
The *Error* method returns an error status, which is a term from the *BRepBuilderAPI_FaceError* enumeration.
-* *FaceDone* - no error occurred.
-* *NoFace* - no initialization of the algorithm; an empty constructor was used.
-* *NotPlanar* - no surface was given and the wire was not planar.
-* *CurveProjectionFailed* - no curve was found in the parametric space of the surface for an edge.
-* *ParametersOutOfRange* - the parameters *umin, umax, vmin, vmax* are out of the surface.
+* *FaceDone* -- no error occurred.
+* *NoFace* -- no initialization of the algorithm; an empty constructor was used.
+* *NotPlanar* -- no surface was given and the wire was not planar.
+* *CurveProjectionFailed* -- no curve was found in the parametric space of the surface for an edge.
+* *ParametersOutOfRange* -- the parameters *umin, umax, vmin, vmax* are out of the surface.
@subsection occt_modalg_3_6 Wire
The wire is a composite shape built not from a geometry, but by the assembly of edges. *BRepBuilderAPI_MakeWire* class can build a wire from one or more edges or connect new edges to an existing wire.
BRepBuilderAPI_MakeWire class can return the last edge added to the wire (Edge method). This edge can be different from the original edge if it was copied.
The Error method returns a term of the *BRepBuilderAPI_WireError* enumeration:
-*WireDone* - no error occurred.
-*EmptyWire* - no initialization of the algorithm, an empty constructor was used.
-*DisconnectedWire* - the last added edge was not connected to the wire.
-*NonManifoldWire* - the wire with some singularity.
+*WireDone* -- no error occurred.
+*EmptyWire* -- no initialization of the algorithm, an empty constructor was used.
+*DisconnectedWire* -- the last added edge was not connected to the wire.
+*NonManifoldWire* -- the wire with some singularity.
@subsection occt_modalg_3_7 Shell
The shell is a composite shape built not from a geometry, but by the assembly of faces.
@subsubsection occt_modalg_4_1_6 Sphere
*BRepPrimAPI_MakeSphere* class allows creating spherical primitives. Like a cylinder, a sphere is created either in the default coordinate system or in a given coordinate system *gp_Ax2*. There are four constructions:
- * From a radius - builds a full sphere.
- * From a radius and an angle - builds a lune (digon).
- * From a radius and two angles - builds a wraparound spherical segment between two latitudes. The angles *a1* and *a2* must follow the relation: <i>PI/2 <= a1 < a2 <= PI/2 </i>.
- * From a radius and three angles - a combination of two previous methods builds a portion of spherical segment.
+ * From a radius -- builds a full sphere.
+ * From a radius and an angle -- builds a lune (digon).
+ * From a radius and two angles -- builds a wraparound spherical segment between two latitudes. The angles *a1* and *a2* must follow the relation: <i>PI/2 <= a1 < a2 <= PI/2 </i>.
+ * From a radius and three angles -- a combination of two previous methods builds a portion of spherical segment.
The following code builds four spheres from a radius and three angles.
@subsubsection occt_modalg_4_1_7 Torus
*BRepPrimAPI_MakeTorus* class allows creating toroidal primitives. Like the other primitives, a torus is created either in the default coordinate system or in a given coordinate system *gp_Ax2*. There are four constructions similar to the sphere constructions:
- * Two radii - builds a full torus.
- * Two radii and an angle - builds an angular torus segment.
- * Two radii and two angles - builds a wraparound torus segment between two radial planes. The angles a1, a2 must follow the relation 0 < a2 - a1 < 2*PI.
- * Two radii and three angles - a combination of two previous methods builds a portion of torus segment.
+ * Two radii -- builds a full torus.
+ * Two radii and an angle -- builds an angular torus segment.
+ * Two radii and two angles -- builds a wraparound torus segment between two radial planes. The angles a1, a2 must follow the relation 0 < a2 - a1 < 2*PI.
+ * Two radii and three angles -- a combination of two previous methods builds a portion of torus segment.
@image html /user_guides/modeling_algos/images/modeling_algos_image032.png "Examples of Tori"
@image latex /user_guides/modeling_algos/images/modeling_algos_image032.png "Examples of Tori"
@image latex /user_guides/modeling_algos/images/modeling_algos_image033.png "Generating a sweep"
*BRepPrimAPI_MakeSweep class* is a deferred class used as a root of the the following sweep classes:
-* *BRepPrimAPI_MakePrism* - produces a linear sweep
-* *BRepPrimAPI_MakeRevol* - produces a rotational sweep
-* *BRepPrimAPI_MakePipe* - produces a general sweep.
+* *BRepPrimAPI_MakePrism* -- produces a linear sweep
+* *BRepPrimAPI_MakeRevol* -- produces a rotational sweep
+* *BRepPrimAPI_MakePipe* -- produces a general sweep.
@subsubsection occt_modalg_4_2_2 Prism
Mechanical features include ribs, protrusions and grooves (or slots), depressions along planar (linear) surfaces or revolution surfaces.
-The semantics of mechanical features is built around giving thickness to a contour. This thickness can either be symmetrical - on one side of the contour - or dissymmetrical - on both sides. As in the semantics of form features, the thickness is defined by construction of shapes in specific contexts.
+The semantics of mechanical features is built around giving thickness to a contour. This thickness can either be symmetrical -- on one side of the contour -- or dissymmetrical -- on both sides. As in the semantics of form features, the thickness is defined by construction of shapes in specific contexts.
The development contexts differ, however, in the case of mechanical features.
Here they include extrusion:
The class is created or initialized from a shape (the basic shape).
Three Add methods are available:
-* *Add(Wire, Face)* - adds a new wire on a face of the basic shape.
-* *Add(Edge, Face)* - adds a new edge on a face of the basic shape.
-* *Add(EdgeNew, EdgeOld)* - adds a new edge on an existing one (the old edge must contain the new edge).
+* *Add(Wire, Face)* -- adds a new wire on a face of the basic shape.
+* *Add(Edge, Face)* -- adds a new edge on a face of the basic shape.
+* *Add(EdgeNew, EdgeOld)* -- adds a new edge on an existing one (the old edge must contain the new edge).
**Note** The added wires and edges must define closed wires on faces or wires located between two existing edges. Existing edges must not be intersected.
However, there some restrictions in HLR use:
* Points are not processed;
- * Z-clipping planes are not used;
* Infinite faces or lines are not processed.
- STL converter translates Open CASCADE shapes to STL files. STL (STtereoLithography) format is widely used for rapid prototyping.
Open CASCADE SAS also offers Advanced Mesh Products:
-- <a href="http://www.opencascade.org/support/products/omf">Open CASCADE Mesh Framework (OMF)</a>
-- <a href="http://www.opencascade.org/support/products/emesh">Express Mesh</a>
+- <a href="http://www.opencascade.com/content/mesh-framework">Open CASCADE Mesh Framework (OMF)</a>
+- <a href="http://www.opencascade.com/content/express-mesh">Express Mesh</a>
Besides, we can efficiently help you in the fields of surface and volume meshing algorithms, mesh optimization algorithms etc. If you require a qualified advice about meshing algorithms, do not hesitate to benefit from the expertise of our team in that domain.
BRepMesh_IncrementalMesh aMesh(aShape, aLinearDeflection, Standard_False, anAngularDeflection);
~~~~~
-The default meshing algorithm *BRepMesh_IncrementalMesh* has two major options to define triangulation – linear and angular deflections.
+The default meshing algorithm *BRepMesh_IncrementalMesh* has two major options to define triangulation -- linear and angular deflections.
At the first step all edges from a face are discretized according to the specified parameters.