1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

Compare commits

...

2 Commits

Author SHA1 Message Date
astromko
d79b8f6cce 0033753: Updating OCCT documentation
Added description and an example for the "offsetperform", "offsetload", "offsetonface" functions in the "Draw Test Harness" section.
Added description for  "offsetperform" function in the "Modeling Algorithms" section.
2024-07-02 12:49:59 +01:00
astromko
ca066529b7 0033753: Updating OCCT documentation
Added description and examples for the "offsetperform" function.
2024-07-01 16:06:07 +01:00
2 changed files with 108 additions and 7 deletions

View File

@@ -4408,7 +4408,63 @@ ellipse e 0 0 0 50 50*sin(angle)
offset l1 e 20 0 0 1
~~~~
@subsubsection occt_draw_6_3_10 revsurf
@subsubsection occt_draw_6_3_10 offsetload
Syntax:
~~~~{.php}
offsetload shape step
~~~~
The offsetload function defines the step by which all the shape's faces will be offset. The step value can be positive or negative that defines the direction of the offset.
@subsubsection occt_draw_6_3_11 offsetonface
Syntax:
~~~~{.php}
offsetonface face_1 step_1 face_2 step_2 ... face_n step_n
~~~~
The offsetonface function defines specific faces of the shape and the specific step for each face by which they will be offset. The step value can be positive or negative that defines the direction of the offset.
@subsubsection occt_draw_6_3_12 offsetperform
Syntax:
~~~~{.php}
offsetperform name
~~~~
The offsetperform function creates a new figure by moving faces of an initial figure. Can move any number of faces. The offset direction is set by a positive or negative step value in the «offsetload» or «offsetonface» commands.
**Example:**
~~~~{.php}
# create a 3d box
box b 10 10 10
# get individual faces of the box
explode b f
# b_1 b_2 b_3 b_4 b_5 b_6
# specify the tolerance and other parameters
# offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k)]
offsetparameter 1e-7 c i r
# specify 0 here to move only specific faces and not all of them
offsetload b 0
# specify which faces to move with a step for each
offsetonface b_2 5 b_3 5 b_6 -2
# perform the offset
offsetperform r
~~~~
If you want to move all the faces for example on step=2 you should specify it in the «offsetload» command like this:
~~~~{.php}
offsetload b 2
~~~~
The «offsetonface» command is not needed in this case.
@subsubsection occt_draw_6_3_13 revsurf
Syntax:
~~~~{.php}
@@ -4428,7 +4484,7 @@ circle c 50 0 0 20
revsurf s c 0 0 0 0 1 0
~~~~
@subsubsection occt_draw_6_3_11 extsurf
@subsubsection occt_draw_6_3_14 extsurf
Syntax:
~~~~{.php}
@@ -4450,7 +4506,7 @@ extsurf s e 0 0 1
trimv s s 0 10
~~~~
@subsubsection occt_draw_6_3_12 convert
@subsubsection occt_draw_6_3_15 convert
Syntax:
~~~~{.php}

View File

@@ -2237,7 +2237,52 @@ The snippets below show usage examples:
NewShape = OffsetMaker2.Shape();
~~~~
@subsubsection occt_modalg_7_2 Shelling
@subsubsection occt_modalg_7_2 Offsetperform function.
The offsetperform functon uses 2 algorithms presented by 2 methods of the *BRepOffset_MakeOffset* class:
* MakeThickSolid: makes a thick solid from the initial one.
* MakeOffsetShape: makes offset of the initial shape.
*MakeOffsetShape* method.
*MakeOffsetShape* can use 2 algorithms:
* BuildOffsetByArc: simply makes offset faces and then creates arcs between them.
* BuildOffsetByInter: constructs offset using intersections.
The *BuildOffsetByArc* algorithm is quite simple while *BuildOffsetByInter* is more complex.
*BuildOffsetByInter* calls *MakeOffsetFaces* and passes to it a map of faces that should be offset.
~~~~{.cpp}
BRepOffset_MakeOffset theOffsetShape;
theOffsetShape.MakeOffsetFaces(/*BRepOffset_DataMapOfShapeOffset&*/ theMapSF,
/*const Message_ProgressRange&*/ theRange);
~~~~
To make an offset, *MakeOffsetFaces* uses the *BRepOffset_Offset* class.
~~~~{.cpp}
BRepOffset_Offset theOffset(/*const TopoDS_Face&*/ Face,
/*const Standard_Real*/ Offset,
/*const Standard_Boolean*/ OffsetOutside,
/*const GeomAbs_JoinType*/ JoinType);
~~~~
*BRepOffset_Offset class* makes an offset of one face. *MakeOffsetFaces* calls BRepOffset_Offset in a cycle to offset all faces.
After the *MakeOffsetFaces* function is finished, *BuildOffsetByInter* uses the *BRepOffset_Inter3d* class to extend our faces if needed and to find intersections between them.
~~~~{.cpp}
BRepOffset_Inter3d theInter3d (/*const Handle (BRepAlgo_AsDes)&*/ AsDes,
/*const TopAbs_State*/ Side,
/*const Standard_Real*/ Tol);
~~~~
Firstly, we find intersections between parallel faces using the *BRepOffset_Inter3d::ConnexIntByInt()* function.
To extend the necessary faces (to ensure that they intersect), *ConnexIntByInt* calls the *BRepOffset_Tool::EnLargeFace* function.
Then we find intersections with caps using the *BRepOffset_Inter3d::ContextIntByInt* function.
After that, the *BRepOffset_MakeOffset::IntersectEdges* function finds intersections between extended faces - intersected edges, which are then trimmed by the *TrimEdges* function.
Now we have offset intersecting faces and a set of intersecting trimmed edges. They need to be combined to obtain the final result. For this purpose there is the *BRepOffset_MakeOffset* class and the *BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces* function. It calls the *IntersectTrimmedEdges* function to fuse all trimmed offset edges and avoid self-intersections in the splits. There are a few key steps here:
* Build splits of faces: performed by the BuildSplitsOfFaces function. At this step we first check if there are any invalid faces or edges. If everything is fine we build the splits.
* Intersect faces: performed by the IntersectFaces function.
Finally, we collect all the history of the operations in the maps of myAsDes - a pointer to the *BRepAlgo_AsDes* class.
@subsubsection occt_modalg_7_3 Shelling
Shelling is used to offset given faces of a solid by a specific value. It rounds or intersects adjacent faces along its edges depending on the convexity of the edge.
The MakeThickSolidByJoin method of the *BRepOffsetAPI_MakeThickSolid* takes the solid, the list of faces to remove and an offset value as input.
@@ -2275,7 +2320,7 @@ Also it is possible to create solid between shell, offset shell. This functional
Solid = SolidMaker.Shape();
~~~~
@subsubsection occt_modalg_7_3 Draft Angle
@subsubsection occt_modalg_7_4 Draft Angle
*BRepOffsetAPI_DraftAngle* class allows modifying a shape by applying draft angles to its planar, cylindrical and conical faces.
@@ -2327,7 +2372,7 @@ else {
@figure{/user_guides/modeling_algos/images/modeling_algos_image043.png,"DraftAngle",420}
@subsubsection occt_modalg_7_4 Pipe Constructor
@subsubsection occt_modalg_7_5 Pipe Constructor
*BRepOffsetAPI_MakePipe* class allows creating a pipe from a Spine, which is a Wire and a Profile which is a Shape. This implementation is limited to spines with smooth transitions, sharp transitions are precessed by *BRepOffsetAPI_MakePipeShell*. To be more precise the continuity must be G1, which means that the tangent must have the same direction, though not necessarily the same magnitude, at neighboring edges.
@@ -2341,7 +2386,7 @@ TopoDS_Shape Pipe = BRepOffsetAPI_MakePipe(Spine,Profile);
@figure{/user_guides/modeling_algos/images/modeling_algos_image044.png,"Example of a Pipe",320}
@subsubsection occt_modalg_7_5 Evolved Solid
@subsubsection occt_modalg_7_6 Evolved Solid
*BRepOffsetAPI_MakeEvolved* class allows creating an evolved solid from a Spine (planar face or wire) and a profile (wire).