Hide menu
modeling/brep/brep.py

Refer to the B-Rep Geometry Creation Example.

edgeutil.py

1 #!/usr/bin/env python3
2 
3 # $Id$
4 
5 # Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
6 # Copyright (C) 2014-2023, CADEX. All rights reserved.
7 
8 # This file is part of the CAD Exchanger software.
9 
10 # You may use this file under the terms of the BSD license as follows:
11 
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions are met:
14 # * Redistributions of source code must retain the above copyright notice,
15 # this list of conditions and the following disclaimer.
16 # * Redistributions in binary form must reproduce the above copyright notice,
17 # this list of conditions and the following disclaimer in the documentation
18 # and/or other materials provided with the distribution.
19 
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
31 
32 
33 import sys
34 from pathlib import Path
35 import os
36 
37 
38 import cadexchanger.CadExCore as cadex
39 import math
40 
42 
43 def MakeEdgeFromLine() -> cadex.ModelData_Edge:
45  return cadex.ModelData_Edge(aCurve, -2.0, 2.0)
46 
47 def MakeEdgeFromCircle() -> cadex.ModelData_Edge:
48  aCurve = cadex.ModelData_Circle(a2Axis, 5.0)
49  return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
50 
51 def MakeEdgeFromEllipse() -> cadex.ModelData_Edge:
52  aCurve = cadex.ModelData_Ellipse(a2Axis, 7.0, 3.0)
53  return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
54 
55 def MakeEdgeFromParabola() -> cadex.ModelData_Edge:
56  aCurve = cadex.ModelData_Parabola(a2Axis, 5.0)
57  return cadex.ModelData_Edge(aCurve, -2.0, 2.0)
58 
59 def MakeEdgeFromHyperbola() -> cadex.ModelData_Edge:
60  aCurve = cadex.ModelData_Hyperbola(a2Axis, 7.0, 3.0)
61  return cadex.ModelData_Edge(aCurve, -2.0, 2.0)
62 
63 def MakeEdgeFromOffSetCurve() -> cadex.ModelData_Edge:
64  aBasisCurve = cadex.ModelData_Circle(a2Axis, 5.0)
65  aCurve = cadex.ModelData_OffsetCurve(aBasisCurve, 10.0, cadex.ModelData_Direction.ZDir())
66  return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
67 
68 def MakeEdgeFromOffsetCurve() -> cadex.ModelData_Edge:
69  aBasisCurve = cadex.ModelData_Circle(a2Axis, 5.0)
70  aCurve = cadex.ModelData_OffsetCurve(aBasisCurve, 10.0, cadex.ModelData_Direction.ZDir())
71  return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
72 
73 def MakeEdgeFromBezier() -> cadex.ModelData_Edge:
74  aPoles = [
75  cadex.ModelData_Point(-2.0, 1.0, 0.0),
76  cadex.ModelData_Point(-1.0,-1.0, 0.0),
77  cadex.ModelData_Point( 0.0, 1.0, 0.0),
78  cadex.ModelData_Point( 1.0,-1.0, 0.0)
79  ]
80 
81  aCurve = cadex.ModelData_BezierCurve(aPoles)
82  return cadex.ModelData_Edge(aCurve)
83 
84 def MakeEdgeFromBSpline() -> cadex.ModelData_Edge:
85  aPoles = [
86  cadex.ModelData_Point(1.0, 1.0, 0.0),
87  cadex.ModelData_Point(2.0, 3.0, 0.0),
88  cadex.ModelData_Point(3.0, 2.0, 0.0),
89  cadex.ModelData_Point(4.0, 3.0, 0.0),
90  cadex.ModelData_Point(5.0, 1.0, 0.0),
91  ]
92 
93  aKnots = [ 0.0, 0.25, 0.75, 1.0 ]
94 
95  aMultiplicities = [ 3, 1, 1, 3 ]
96 
97  aDegree = 2
98  aCurve = cadex.ModelData_BSplineCurve(aPoles, aKnots, aMultiplicities, aDegree)
99  return cadex.ModelData_Edge(aCurve)

faceutil.py

1 #!/usr/bin/env python3
2 
3 # $Id$
4 
5 # Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
6 # Copyright (C) 2014-2023, CADEX. All rights reserved.
7 
8 # This file is part of the CAD Exchanger software.
9 
10 # You may use this file under the terms of the BSD license as follows:
11 
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions are met:
14 # * Redistributions of source code must retain the above copyright notice,
15 # this list of conditions and the following disclaimer.
16 # * Redistributions in binary form must reproduce the above copyright notice,
17 # this list of conditions and the following disclaimer in the documentation
18 # and/or other materials provided with the distribution.
19 
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
31 
32 
33 import sys
34 from pathlib import Path
35 import os
36 
37 
38 import cadexchanger.CadExCore as cadex
39 import math
40 
42 
43 def MakePlanarFace() -> cadex.ModelData_Face:
44  aSurface = cadex.ModelData_Plane(a3Axis)
45  return cadex.ModelData_Face(aSurface, -2.0, 2.0, -2.0, 2.0)
46 
47 def MakeSphericalFace() -> cadex.ModelData_Face:
48  aSurface = cadex.ModelData_SphericalSurface(a3Axis, 10.0)
49  return cadex.ModelData_Face(aSurface, 0.0, math.pi / 2, 0.0, math.pi / 2)
50 
51 def MakeCylindricalFace() -> cadex.ModelData_Face:
52  aSurface = cadex.ModelData_CylindricalSurface(a3Axis, 10.0)
53  return cadex.ModelData_Face(aSurface, 0.0, math.pi, -2.0, 2.0)
54 
55 def MakeConicalFace() -> cadex.ModelData_Face:
56  aSurface = cadex.ModelData_ConicalSurface(a3Axis, 1.0, 7.0)
57  return cadex.ModelData_Face(aSurface, 0.0, math.pi, 0.0, math.pi)
58 
59 def MakeToroidalFace() -> cadex.ModelData_Face:
60  aSurface = cadex.ModelData_ToroidalSurface(a3Axis, 7.0, 3.0)
61  return cadex.ModelData_Face(aSurface, 0.0, math.pi, 0.0, math.pi)
62 
63 def MakeFaceFromSurfaceOfLinearExtrusion() -> cadex.ModelData_Face:
64  aPoles = [
65  cadex.ModelData_Point(-2.0, 1.0, 0.0),
66  cadex.ModelData_Point(-1.0, -1.0, 0.0),
67  cadex.ModelData_Point( 0.0, 1.0, 0.0),
68  cadex.ModelData_Point( 1.0, -1.0, 0.0),
69  cadex.ModelData_Point( 2.0, 1.0, 0.0)
70  ]
71 
72  aBasisCurve = cadex.ModelData_BezierCurve(aPoles)
73 
75  return cadex.ModelData_Face(aSurface, 0.1, 0.9, -10.0, 10.0)
76 
77 def MakeFaceFromSurfaceOfRevolution() -> cadex.ModelData_Face:
78  aPoles = [
79  cadex.ModelData_Point(-2.0, 1.0, 0.0),
80  cadex.ModelData_Point(-1.0, 3.0, 0.0),
81  cadex.ModelData_Point( 0.0, 2.0, 0.0),
82  cadex.ModelData_Point( 1.0, 1.0, 0.0),
83  cadex.ModelData_Point( 2.0, 2.0, 0.0)
84  ]
85 
86  aBasisCurve = cadex.ModelData_BezierCurve(aPoles)
87 
88  aSurface = cadex.ModelData_SurfaceOfRevolution(aBasisCurve,
89  cadex.ModelData_Point(0.0, 0.0, 0.0),
91  return cadex.ModelData_Face(aSurface, 0.0, math.pi + math.pi / 2, 0.1, 0.9)
92 
93 def MakeFaceFromOffsetSurface() -> cadex.ModelData_Face:
94  aPoles = [
95  cadex.ModelData_Point(0.0, 0.0, 1.0),
96  cadex.ModelData_Point(0.0, 2.0, 1.0),
97  cadex.ModelData_Point(2.0, 0.0, 1.0),
98  cadex.ModelData_Point(2.0, 2.0, -1.0)
99  ]
100 
101  aBasisSurface = cadex.ModelData_BezierSurface(aPoles, 2, 2)
102  aSurface = cadex.ModelData_OffsetSurface(aBasisSurface, 10.0)
103  return cadex.ModelData_Face(aSurface, 0.1, 0.9, 0.1, 0.9)
104 
105 def MakeFaceFromBezier() -> cadex.ModelData_Face:
106  aPoles = [
107  cadex.ModelData_Point(0.0, 0.0, 1.0),
108  cadex.ModelData_Point(0.0, 2.0, 1.0),
109  cadex.ModelData_Point(2.0, 0.0, 1.0),
110  cadex.ModelData_Point(2.0, 2.0, -1.0)
111  ]
112 
113  aSurface = cadex.ModelData_BezierSurface(aPoles, 2, 2)
114  return cadex.ModelData_Face(aSurface, 0.25, 0.75, 0.25, 0.75)
115 
116 def MakeFaceFromBSpline() -> cadex.ModelData_Face:
117  aPoles = [
118  cadex.ModelData_Point( 0.0, 0.0, 1.0),
119  cadex.ModelData_Point( 0.0, 2.0, 3.0),
120  cadex.ModelData_Point( 0.0, 6.0, 2.0),
121  cadex.ModelData_Point( 0.0, 8.0, 3.0),
122  cadex.ModelData_Point( 0.0, 10.0, 1.0),
123 
124  cadex.ModelData_Point( 2.0, 0.0, 2.0),
125  cadex.ModelData_Point( 2.0, 2.0, 2.0),
126  cadex.ModelData_Point( 2.0, 6.0, 2.0),
127  cadex.ModelData_Point( 2.0, 8.0, 2.0),
128  cadex.ModelData_Point( 2.0, 10.0, 2.0),
129 
130  cadex.ModelData_Point( 4.0, 0.0, 3.0),
131  cadex.ModelData_Point( 4.0, 2.0, 1.0),
132  cadex.ModelData_Point( 4.0, 6.0, 2.0),
133  cadex.ModelData_Point( 4.0, 8.0, 1.0),
134  cadex.ModelData_Point( 4.0, 10.0, 3.0),
135 
136  cadex.ModelData_Point( 6.0, 0.0, 2.0),
137  cadex.ModelData_Point( 6.0, 2.0, 2.0),
138  cadex.ModelData_Point( 6.0, 6.0, 2.0),
139  cadex.ModelData_Point( 6.0, 8.0, 2.0),
140  cadex.ModelData_Point( 6.0, 10.0, 2.0),
141 
142  cadex.ModelData_Point(10.0, 0.0, 3.0),
143  cadex.ModelData_Point(10.0, 2.0, 1.0),
144  cadex.ModelData_Point(10.0, 6.0, 2.0),
145  cadex.ModelData_Point(10.0, 8.0, 1.0),
146  cadex.ModelData_Point(10.0, 10.0, 3.0)
147  ]
148 
149  aUPoles = 5
150  aVPoles = 5
151 
152  aUKnots = [ 0.0, 0.25, 0.75, 1.0]
153  aVKnots = [ 0.0, 0.25, 0.75, 1.0 ]
154 
155  aVMultiplicities = [ 3, 1, 1, 3 ]
156  aUMultiplicities = [ 3, 1, 1, 3 ]
157 
158  aUDegree = 2
159  aVDegree = 2
160 
161  aSurface = cadex.ModelData_BSplineSurface(aPoles, aUPoles, aVPoles, aUKnots, aVKnots,
162  aUMultiplicities, aVMultiplicities,
163  aUDegree, aVDegree)
164  return cadex.ModelData_Face(aSurface, 0.25, 0.75, 0.25, 0.75)
165 
166 def MakeFaceWithInnerWire() -> cadex.ModelData_Face:
168  anInnerCircle = cadex.ModelData_Circle(anAxis2, 10.0)
169  anOuterCircle = cadex.ModelData_Circle(anAxis2, 20.0)
170 
171  anOuterEdge = cadex.ModelData_Edge(anOuterCircle)
172  anInnerEdge = cadex.ModelData_Edge(anInnerCircle)
173 
174  anOuterWire = cadex.ModelData_Wire(anOuterEdge)
175  anInnerWire = cadex.ModelData_Wire(cadex.ModelData_Edge.Cast(anInnerEdge.Reversed()))
176 
177  anAxis3 = cadex.ModelData_Axis3Placement(anAxis2)
178  aPlane = cadex.ModelData_Plane(anAxis3)
179  aFace = cadex.ModelData_Face(aPlane)
180 
181  aFace.Append(anOuterWire)
182  aFace.Append(anInnerWire)
183 
184  return aFace

bodyutil.py

1 #!/usr/bin/env python3
2 
3 # $Id$
4 
5 # Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
6 # Copyright (C) 2014-2023, CADEX. All rights reserved.
7 
8 # This file is part of the CAD Exchanger software.
9 
10 # You may use this file under the terms of the BSD license as follows:
11 
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions are met:
14 # * Redistributions of source code must retain the above copyright notice,
15 # this list of conditions and the following disclaimer.
16 # * Redistributions in binary form must reproduce the above copyright notice,
17 # this list of conditions and the following disclaimer in the documentation
18 # and/or other materials provided with the distribution.
19 
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
31 
32 
33 import sys
34 from pathlib import Path
35 import os
36 
37 
38 import cadexchanger.CadExCore as cadex
39 
40 sys.path.append(os.path.abspath(os.path.dirname(Path(__file__).resolve()) + r"/../../"))
41 import cadex_license as license
42 
43 
44 def MakeSolidBody() -> cadex.ModelData_Body:
46  aBody = cadex.ModelData_Body.Create(aSolid);
47  return aBody;
48 
49 def MakeSheetBody() -> cadex.ModelData_Body:
51  aFace1 = cadex.ModelData_Face(aPlane, -4.0, 0.0, -4.0, 0.0);
52  aFace2 = cadex.ModelData_Face(aPlane, 0.0, 4.0, 0.0, 4.0);
53 
54  aShell = cadex.ModelData_Shell(aFace1);
55  aShell.Append(aFace2);
56 
57  aBody = cadex.ModelData_Body.Create(aShell);
58  return aBody;
59 
60 def MakeWireframeBody() -> cadex.ModelData_Body:
64  aCircle = cadex.ModelData_Circle(anAxis, 5.0);
65  anEdge1 = cadex.ModelData_Edge(aCircle, 1.0, 3.0);
66  anEdge2 = cadex.ModelData_Edge(aCircle, 1.0, 3.0);
67 
68  aWire = cadex.ModelData_Wire(anEdge1);
69  aWire.Append(anEdge2);
70 
71  aBody = cadex.ModelData_Body.Create(aWire);
72  return aBody;
73 
74 def MakeAcornBody() -> cadex.ModelData_Body:
75  aVertex = cadex.ModelData_Vertex(cadex.ModelData_Point(0.0, 0.0, 0.0));
76  aBody = cadex.ModelData_Body.Create(aVertex);
77  return aBody;

brep.py

1 #!/usr/bin/env python3
2 
3 # $Id$
4 
5 # Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
6 # Copyright (C) 2014-2023, CADEX. All rights reserved.
7 
8 # This file is part of the CAD Exchanger software.
9 
10 # You may use this file under the terms of the BSD license as follows:
11 
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions are met:
14 # * Redistributions of source code must retain the above copyright notice,
15 # this list of conditions and the following disclaimer.
16 # * Redistributions in binary form must reproduce the above copyright notice,
17 # this list of conditions and the following disclaimer in the documentation
18 # and/or other materials provided with the distribution.
19 
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
31 
32 
33 import sys
34 from pathlib import Path
35 import os
36 
37 import cadexchanger.CadExCore as cadex
38 import bodyutil
39 import edgeutil
40 import faceutil
41 
42 sys.path.append(os.path.abspath(os.path.dirname(Path(__file__).resolve()) + r"/../../"))
43 import cadex_license as license
44 
45 
46 def SaveModel(theShape: cadex.ModelData_Shape, theName: str) -> bool:
47  aModel = cadex.ModelData_Model()
48  aBRep = cadex.ModelData_BRepRepresentation(theShape)
49  aPart = cadex.ModelData_Part(aBRep, cadex.Base_UTF16String(theName))
50  aModel.AddRoot(aPart)
51 
52  aPath = "out/" + str(theName) + ".xml"
53  return cadex.ModelData_ModelWriter().Write(aModel, cadex.Base_UTF16String(aPath))
54 
55 def main():
56  aKey = license.Value()
57 
58  if not cadex.LicenseManager.Activate(aKey):
59  print("Failed to activate CAD Exchanger license.")
60  return 1
61 
62  aLine = edgeutil.MakeEdgeFromLine()
63  SaveModel(aLine, cadex.Base_UTF16String("LineEdge"))
64  aCircle = edgeutil.MakeEdgeFromCircle()
65  SaveModel(aCircle, cadex.Base_UTF16String("CircleEdge"))
66  anEllipse = edgeutil.MakeEdgeFromEllipse()
67  SaveModel(anEllipse, cadex.Base_UTF16String("EllipseEdge"))
68  aParabola = edgeutil.MakeEdgeFromParabola()
69  SaveModel(aParabola, cadex.Base_UTF16String("ParabolaEdge"))
70  aHyperbola = edgeutil.MakeEdgeFromHyperbola()
71  SaveModel(aHyperbola, cadex.Base_UTF16String("HyperbolaEdge"))
72  anEdgeFromOffsetCurve = edgeutil.MakeEdgeFromOffSetCurve()
73  SaveModel(anEdgeFromOffsetCurve, cadex.Base_UTF16String("OffsetEdge"))
74  aBezierEdge = edgeutil.MakeEdgeFromBezier()
75  SaveModel(aBezierEdge, cadex.Base_UTF16String("BezierEdge"))
76  aBSplineEdge = edgeutil.MakeEdgeFromBSpline()
77  SaveModel(aBSplineEdge, cadex.Base_UTF16String("BSplineEdge"))
78 
79  aPlane = faceutil.MakePlanarFace()
80  SaveModel(aPlane, cadex.Base_UTF16String("PlaneFace"))
81  aSphere = faceutil.MakeSphericalFace()
82  SaveModel(aSphere, cadex.Base_UTF16String("SphereFace"))
83  aCylinder = faceutil.MakeCylindricalFace()
84  SaveModel(aCylinder, cadex.Base_UTF16String("CylinderFace"))
85  aCone = faceutil.MakeConicalFace()
86  SaveModel(aCone, cadex.Base_UTF16String("ConeFace"))
87  aTorus = faceutil.MakeToroidalFace()
88  SaveModel(aTorus, cadex.Base_UTF16String("TorusFace"))
89  aFaceFromLESurface = faceutil.MakeFaceFromSurfaceOfLinearExtrusion()
90  SaveModel(aFaceFromLESurface, cadex.Base_UTF16String("LEFace"))
91  aFaceFromRevSurface = faceutil.MakeFaceFromSurfaceOfRevolution()
92  SaveModel(aFaceFromRevSurface, cadex.Base_UTF16String("RevFace"))
93  aFaceFromOffsetSurface = faceutil.MakeFaceFromOffsetSurface()
94  SaveModel(aFaceFromOffsetSurface, cadex.Base_UTF16String("OffsetFace"))
95  aBezierFace = faceutil.MakeFaceFromBezier()
96  SaveModel(aBezierFace, cadex.Base_UTF16String("BezierFace"))
97  aBSplineFace = faceutil.MakeFaceFromBSpline()
98  SaveModel(aBSplineFace, cadex.Base_UTF16String("BSplineFace"))
99  aFace = faceutil.MakeFaceWithInnerWire()
100  SaveModel(aFace, cadex.Base_UTF16String("InnerWireFace"))
101 
102  aSolid = bodyutil.MakeSolidBody()
103  SaveModel(aSolid, cadex.Base_UTF16String("SolidBody"))
104  aSheet = bodyutil.MakeSheetBody()
105  SaveModel(aSheet, cadex.Base_UTF16String("SheetBody"))
106  aWireframe = bodyutil.MakeWireframeBody()
107  SaveModel(aWireframe, cadex.Base_UTF16String("WireframeBody"))
108  anAcorn = bodyutil.MakeAcornBody()
109  SaveModel(anAcorn, cadex.Base_UTF16String("AcornBody"))
110 
111  print("Completed")
112  return 0
113 
114 if __name__ == "__main__":
115  sys.exit(main())
116 
Defines 3D circle.
Definition: ModelData_Circle.hxx:32
static const ModelData_Edge & Cast(const ModelData_Shape &theShape)
Casts a base class object to ModelData_Edge.
Definition: ModelData_Edge.cxx:688
Defines a cylindrical surface.
Definition: ModelData_CylindricalSurface.hxx:31
Defines a 3D point.
Definition: ModelData_Point.hxx:294
Defines 3D hyperbola.
Definition: ModelData_Hyperbola.hxx:31
static ModelData_Solid CreateBox(double theDx, double theDy, double theDz)
Creates a box.
Definition: ModelAlgo_TopoPrimitives.cxx:82
Defines a connected set of faces.
Definition: ModelData_Shell.hxx:30
Defines a surface of linear extrusion.
Definition: ModelData_SurfaceOfLinearExtrusion.hxx:33
Defines a plane.
Definition: ModelData_Plane.hxx:31
static const ModelData_Direction & ZDir()
Definition: ModelData_Direction.cxx:67
Defines 3D parabola.
Definition: ModelData_Parabola.hxx:31
static const ModelData_Direction & XDir()
Definition: ModelData_Direction.cxx:55
Defines a topological face.
Definition: ModelData_Face.hxx:31
Defines 3D offset curve.
Definition: ModelData_OffsetCurve.hxx:32
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:33
Defines a surface of revolution.
Definition: ModelData_SurfaceOfRevolution.hxx:34
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:40
Defines 3D ellipse.
Definition: ModelData_Ellipse.hxx:31
Defines an offset surface.
Definition: ModelData_OffsetSurface.hxx:31
Defines 3D Bezier curve.
Definition: ModelData_BezierCurve.hxx:35
Defines a Bezier surface.
Definition: ModelData_BezierSurface.hxx:33
Defines a B-Spline surface.
Definition: ModelData_BSplineSurface.hxx:33
Defines a conical surface.
Definition: ModelData_ConicalSurface.hxx:31
Defines topological vertex.
Definition: ModelData_Vertex.hxx:30
static ModelData_Body Create(const ModelData_Shape &theShape)
Creates a body from an arbitrary shape.
Definition: ModelData_Body.cxx:223
Writes any format that CAD Exchanger can export.
Definition: ModelData_ModelWriter.hxx:31
Defines 3D B-Spline curve.
Definition: ModelData_BSplineCurve.hxx:33
Defines a toroidal surface.
Definition: ModelData_ToroidalSurface.hxx:31
Defines a right-handed or left-handed axis placement in 3D.
Definition: ModelData_Axis3Placement.hxx:37
Defines a spherical surface.
Definition: ModelData_SphericalSurface.hxx:31
Defines 3D line.
Definition: ModelData_Line.hxx:35
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:34
Defines a right-hand axis placement in 3D.
Definition: ModelData_Axis2Placement.hxx:37
Defines a connected set of edges.
Definition: ModelData_Wire.hxx:30
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:38
Defines an edge.
Definition: ModelData_Edge.hxx:35