Hide menu
Loading...
Searching...
No Matches
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
33import sys
34from pathlib import Path
35import os
36
37
38import cadexchanger.CadExCore as cadex
39import math
40
42
43def MakeEdgeFromLine() -> cadex.ModelData_Edge:
45 return cadex.ModelData_Edge(aCurve, -2.0, 2.0)
46
47def MakeEdgeFromCircle() -> cadex.ModelData_Edge:
48 aCurve = cadex.ModelData_Circle(a2Axis, 5.0)
49 return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
50
51def 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
55def MakeEdgeFromParabola() -> cadex.ModelData_Edge:
56 aCurve = cadex.ModelData_Parabola(a2Axis, 5.0)
57 return cadex.ModelData_Edge(aCurve, -2.0, 2.0)
58
59def 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
63def MakeEdgeFromOffSetCurve() -> cadex.ModelData_Edge:
64 aBasisCurve = cadex.ModelData_Circle(a2Axis, 5.0)
66 return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
67
68def MakeEdgeFromOffsetCurve() -> cadex.ModelData_Edge:
69 aBasisCurve = cadex.ModelData_Circle(a2Axis, 5.0)
71 return cadex.ModelData_Edge(aCurve, 0.0, math.pi)
72
73def 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
84def 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)
Defines a right-hand axis placement in 3D.
Definition: ModelData_Axis2Placement.hxx:38
Defines 3D B-Spline curve.
Definition: ModelData_BSplineCurve.hxx:34
Defines 3D Bezier curve.
Definition: ModelData_BezierCurve.hxx:36
Defines 3D circle.
Definition: ModelData_Circle.hxx:33
static const ModelData_Direction & ZDir()
Definition: ModelData_Direction.cxx:108
static const ModelData_Direction & XDir()
Definition: ModelData_Direction.cxx:96
Defines an edge.
Definition: ModelData_Edge.hxx:36
Defines 3D ellipse.
Definition: ModelData_Ellipse.hxx:32
Defines 3D hyperbola.
Definition: ModelData_Hyperbola.hxx:32
Defines 3D line.
Definition: ModelData_Line.hxx:36
Defines 3D offset curve.
Definition: ModelData_OffsetCurve.hxx:33
Defines 3D parabola.
Definition: ModelData_Parabola.hxx:32
Defines a 3D point.
Definition: ModelData_Point.hxx:295

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
33import sys
34from pathlib import Path
35import os
36
37
38import cadexchanger.CadExCore as cadex
39import math
40
42
43def 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
47def 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
51def 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
55def 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
59def 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
63def 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
77def 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
93def 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
105def 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
116def 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
166def 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
Defines a right-handed or left-handed axis placement in 3D.
Definition: ModelData_Axis3Placement.hxx:38
Defines a B-Spline surface.
Definition: ModelData_BSplineSurface.hxx:34
Defines a Bezier surface.
Definition: ModelData_BezierSurface.hxx:34
Defines a conical surface.
Definition: ModelData_ConicalSurface.hxx:32
Defines a cylindrical surface.
Definition: ModelData_CylindricalSurface.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 topological face.
Definition: ModelData_Face.hxx:32
Defines an offset surface.
Definition: ModelData_OffsetSurface.hxx:32
Defines a plane.
Definition: ModelData_Plane.hxx:32
Defines a spherical surface.
Definition: ModelData_SphericalSurface.hxx:32
Defines a surface of linear extrusion.
Definition: ModelData_SurfaceOfLinearExtrusion.hxx:34
Defines a surface of revolution.
Definition: ModelData_SurfaceOfRevolution.hxx:35
Defines a toroidal surface.
Definition: ModelData_ToroidalSurface.hxx:32
Defines a connected set of edges.
Definition: ModelData_Wire.hxx:31

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
33import sys
34from pathlib import Path
35import os
36
37
38import cadexchanger.CadExCore as cadex
39
40sys.path.append(os.path.abspath(os.path.dirname(Path(__file__).resolve()) + r"/../../"))
41
42
43def MakeSolidBody() -> cadex.ModelData_Body:
45 aBody = cadex.ModelData_Body.Create(aSolid);
46 return aBody;
47
48def MakeSheetBody() -> cadex.ModelData_Body:
50 aFace1 = cadex.ModelData_Face(aPlane, -4.0, 0.0, -4.0, 0.0);
51 aFace2 = cadex.ModelData_Face(aPlane, 0.0, 4.0, 0.0, 4.0);
52
53 aShell = cadex.ModelData_Shell(aFace1);
54 aShell.Append(aFace2);
55
56 aBody = cadex.ModelData_Body.Create(aShell);
57 return aBody;
58
59def MakeWireframeBody() -> cadex.ModelData_Body:
63 aCircle = cadex.ModelData_Circle(anAxis, 5.0);
64 anEdge1 = cadex.ModelData_Edge(aCircle, 1.0, 3.0);
65 anEdge2 = cadex.ModelData_Edge(aCircle, 1.0, 3.0);
66
67 aWire = cadex.ModelData_Wire(anEdge1);
68 aWire.Append(anEdge2);
69
70 aBody = cadex.ModelData_Body.Create(aWire);
71 return aBody;
72
73def MakeAcornBody() -> cadex.ModelData_Body:
74 aVertex = cadex.ModelData_Vertex(cadex.ModelData_Point(0.0, 0.0, 0.0));
75 aBody = cadex.ModelData_Body.Create(aVertex);
76 return aBody;
static ModelData_Solid CreateBox(double theDx, double theDy, double theDz)
Creates a box.
Definition: ModelAlgo_TopoPrimitives.cxx:86
static ModelData_Body Create(const ModelData_Shape &theShape)
Creates a body from an arbitrary shape.
Definition: ModelData_Body.cxx:223
Defines a connected set of faces.
Definition: ModelData_Shell.hxx:31
Defines topological vertex.
Definition: ModelData_Vertex.hxx:31

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
33import sys
34from pathlib import Path
35import os
36
37import cadexchanger.CadExCore as cadex
38import bodyutil
39import edgeutil
40import faceutil
41
42sys.path.append(os.path.abspath(os.path.dirname(Path(__file__).resolve()) + r"/../../"))
43import cadex_license as license
44
45
46def SaveModel(theShape: cadex.ModelData_Shape, theName: str) -> bool:
47 aModel = cadex.ModelData_Model()
49 aPart = cadex.ModelData_Part(aBRep, cadex.Base_UTF16String(theName))
50 aModel.AddRoot(aPart)
51
52 aPath = "out/" + str(theName) + ".cdx"
53 return cadex.ModelData_ModelWriter().Write(aModel, cadex.Base_UTF16String(aPath))
54
55def 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
114if __name__ == "__main__":
115 sys.exit(main())
116
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:34
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
Writes any format that CAD Exchanger can export.
Definition: ModelData_ModelWriter.hxx:33
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35