Version: 6.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
GEOM_TestAll.py


GEOM_TestAll.py

def TestAll (geompy, math):

import GEOM
#Create base Variables
nbtimes1 = 5 #Short
nbtimes2 = 5
mindeg = 2
maxdeg = 5
nbiter = 5
WantPlanarFace = 1 #True
radius = 10. #Double
radius1 = 100.
radius2 = 200.
height = 200.
d1 = 10.
d2 = 10.
step1 = 250.
step2 = 250.
angle = 45.
angle1 = angle * math.pi / 180
angle2 = 2 * angle1
factor = 2.
tol3d = 0.0001
tol2d = 0.0001
weight = 1000000.
waterdensity = 1.
meshingdeflection = 0.01
trimsize = 1000.
precision = 0.00001
#Create base points
p0 = geompy.MakeVertex(0. , 0. , 0. ) #(3 Doubles)->GEOM_Object
px = geompy.MakeVertex(100., 0. , 0. )
py = geompy.MakeVertex(0. , 100., 0. )
pz = geompy.MakeVertex(0. , 0. , 100.)
pxyz = geompy.MakeVertex(100., 100., 100.)
p200 = geompy.MakeVertexWithRef(pxyz, 100., 100., 100.) #(GEOM_Object, 3 Doubles)->GEOM_Object
#Create base directions
vx = geompy.MakeVector(p0, px) #(GEOM_Object, GEOM_Object)->GEOM_Object
vy = geompy.MakeVector(p0, py)
vz = geompy.MakeVector(p0, pz)
vxy = geompy.MakeVector(px, py)
vxyz = geompy.MakeVectorDXDYDZ(100., 100., 100.) #(3 Doubles)->GEOM_Object

#Create local coordinate systems
cs1 = geompy.MakeMarker(50,50,50, 1,0,0, 0,1,0) #(9 Doubles)->GEOM_Object
cs2 = geompy.MakeMarker(70,80,10, 1,0,1, 1,1,0) #(9 Doubles)->GEOM_Object
cs3 = geompy.MakeMarkerPntTwoVec(pz, vxy, vz) #(3 GEOM_Object)->GEOM_Object

#Create base geometry 2D
Line = geompy.MakeLineTwoPnt(p0, pxyz) #(2 GEOM_Object)->GEOM_Object
Line1 = geompy.MakeLine(pz, vxy) #(2 GEOM_Object)->GEOM_Object
Line2 = geompy.MakeLineTwoPnt(pxyz, pz) #(2 GEOM_Object)->GEOM_Object
Plane = geompy.MakePlane(pz, vxyz, trimsize) #(2 GEOM_Object, Double)->GEOM_Object
Plane1 = geompy.MakePlaneThreePnt(px, pz, p200, trimsize) #(4 Doubles)->GEOM_Object
Plane2 = geompy.MakePlane2Vec(vx, vz, trimsize) #(2 GEOM_Object, Double)->GEOM_Object
Plane3 = geompy.MakePlaneLCS(cs1, trimsize, 3) #(1 GEOM_Object, 2 Double)->GEOM_Object

Arc = geompy.MakeArc(py, pz, px) #(3 GEOM_Object)->GEOM_Object
Arc2 = geompy.MakeArcCenter(py, pz, px,0) #(3 GEOM_Object,Boolean)->GEOM_Object
Arc3 = geompy.MakeArcOfEllipse(p0, px, pz) #(3 GEOM_Object,Boolean)->GEOM_Object

Circle = geompy.MakeCircle(p0, vz, radius1) #(2 GEOM_Object, Double)->GEOM_Object
Circle1 = geompy.MakeCircleThreePnt(p0, pxyz, px) #(3 GEOM_Object)->GEOM_Object
Circle2 = geompy.MakeCircleCenter2Pnt(p0, pxyz, py) #(3 GEOM_Object)->GEOM_Object

Ellipse = geompy.MakeEllipse(p0, vy, radius2, radius1) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
Polyline = geompy.MakePolyline([p0, pz, py, p200]) #(List of GEOM_Object)->GEOM_Object
Bezier = geompy.MakeBezier([p0, pz, p200, px]) #(List of GEOM_Object)->GEOM_Object
Interpol = geompy.MakeInterpol([px, py, p200, pxyz], True) #(List of GEOM_Object,Boolean)->GEOM_Object
Sketcher = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
[100,0,0, 1,1,1, -1,1,0]) #(String, List of Doubles)->GEOM_Object
Sketcher3d = geompy.Make3DSketcher([0,0,0, 50,50,50, 0,50,50, 10,0,0])
#Create local coordinate system from shape
cs4 = geompy.MakeMarkerFromShape(Plane)
#Test point on curve creation
p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25) #(GEOM_Object, Double)->GEOM_Object
p_on_arc2 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10 ) #(GEOM_Object, Double)->GEOM_Object
p_on_arc3 = geompy.MakeVertexOnCurveByLength(Arc, 50, py) #(GEOM_Object, Double, GEOM_Object)->GEOM_Object

#Test point on lines intersection
p_on_l1l2 = geompy.MakeVertexOnLinesIntersection(Line1, Line2) #(2 GEOM_Object)->GEOM_Object

#Test tangent on curve creation
tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object, Double)->GEOM_Object

#Test tangent on face creation
tan_vertex_1 = geompy.MakeVertex(0, 0, 0)
tan_vertex_2 = geompy.MakeVertex(0, 90, 30)
tan_vertex_3 = geompy.MakeVertex(100, 90, 0)
tan_vertex_4 = geompy.MakeVertex(-100, 90, 0)
tan_curve = geompy.MakeInterpol([tan_vertex_4, tan_vertex_2, tan_vertex_3, tan_vertex_1], False)
tan_extrusion = geompy.MakePrismDXDYDZ(tan_curve, 0, 30, -60)
tan_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)

#Create base geometry 3D
Box = geompy.MakeBoxTwoPnt(p0, p200) #(2 GEOM_Object)->GEOM_Object
Box1 = geompy.MakeBoxDXDYDZ(10, 20, 30) #(3 Doubles)->GEOM_Object
Box2 = geompy.MakeBox(10,20,30, 15,25,35) #(6 Doubles)->GEOM_Object
Cylinder = geompy.MakeCylinder(p0, vz, radius1, height) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
Cyl1 = geompy.MakeCylinderRH(radius2, height) #(2 Doubles)->GEOM_Object
Sphere = geompy.MakeSpherePntR(p0, radius1) #(GEOM_Object, Double)->GEOM_Object
Sphere1 = geompy.MakeSphereR(radius) #(Double)->GEOM_Object
Sphere2 = geompy.MakeSphere(50, 70, 30, radius) #(4 Doubles)->GEOM_Object
Cone = geompy.MakeCone(p0, vz, radius2, radius, height) #(2 GEOM_Object, 3 Doubles)->GEOM_Object
Cone1 = geompy.MakeConeR1R2H(radius1, radius, height) #(3 Doubles)->GEOM_Object
Torus = geompy.MakeTorus(p0, vz, radius2, radius) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
Torus1 = geompy.MakeTorusRR(radius2, radius1) #(2 Doubles)->GEOM_Object
#Boolean (Common, Cut, Fuse, Section)
Common = geompy.MakeBoolean(Box, Sphere, 1) #(2 GEOM_Object, Short)->GEOM_Object
Cut = geompy.MakeBoolean(Box, Sphere, 2)
Fuse = geompy.MakeBoolean(Box, Sphere, 3)
Section = geompy.MakeBoolean(Box, Sphere, 4)
#Create base objects
Edge = geompy.MakeEdge(p0, pxyz) #(2 GEOM_Object)->GEOM_Object
Edge1 = geompy.MakeEdgeOnCurveByLength(Arc, 50, px) #(GEOM_Object, Double, GEOM_Object)->GEOM_Object
Wire = geompy.MakeWire([vxy, Arc]) #(List Of GEOM_Object)->GEOM_Object
Face = geompy.MakeFace(Wire, WantPlanarFace) #(GEOM_Object, Boolean)->GEOM_Object
Face1 = geompy.MakeFaceWires([Wire, Sketcher],
WantPlanarFace) #(List of GEOM_Object, Boolean)->GEOM_Object
Face2 = geompy.MakeFace(Sketcher, WantPlanarFace)
Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object
Face4 = geompy.MakeFaceObjHW (vz, 200., 100.) #(1 GEOM_Object, 2 Doubles)->GEOM_Object
Disk = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object, 1 Double)->GEOM_Object
Disk2 = geompy.MakeDiskThreePnt(p0, p200, pz) #(3 GEOM_Object)->GEOM_Object
Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object
Shell = geompy.MakeShell([Face, Face1]) #(List of GEOM_Object)->GEOM_Object
Prism1 = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
prism1_faces = geompy.SubShapeAllSortedCentres(Prism1, geompy.ShapeType["FACE"])
Shell1 = geompy.MakeShell([prism1_faces[0], prism1_faces[1],
prism1_faces[3], prism1_faces[4],
prism1_faces[5], prism1_faces[2]])
Solid = geompy.MakeSolid([Shell1]) #(List of GEOM_Object)->GEOM_Object
ShapeListCompound = []
i = 0
while i <= 3 :
S = geompy.MakeTranslation(Arc, i * 100., i * 100., i * 100.)
ShapeListCompound.append(S)
i = i + 1
Compound = geompy.MakeCompound(ShapeListCompound) #(List of GEOM_Object)->GEOM_Object

#Test point on surface creation
p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object, Double, Double)->GEOM_Object

p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object, Double, Double, Double)->GEOM_Object

# Test plane from existing face creation
Plane2 = geompy.MakePlaneFace(Face, trimsize) #(GEOM_Object, Double)->GEOM_Object
#ShapeList for Sewing
S = geompy.MakeRotation(Face, vxy, angle1)

#Test Line on Faces Intersection
Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object

#Create advanced objects
Copy = geompy.MakeCopy(Box) #(GEOM_Object)->GEOM_Object
Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object, Double)->GEOM_Object
Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
PrismTwoPnt = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
PrismTwoPnt2Ways = geompy.MakePrism2Ways(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
PrismDXDYDZ = geompy.MakePrismDXDYDZ(Face2, 10, 20, 100)#(2 GEOM_Object, Double)->GEOM_Object
PrismDXDYDZ2Ways = geompy.MakePrismDXDYDZ2Ways(Face, 30, -20, 200)#(2 GEOM_Object, Double)->GEOM_Object
Revolution = geompy.MakeRevolution(Face, vz, angle2) #
Revolution2Ways = geompy.MakeRevolution(Face, vz, angle1) #
Filling = geompy.MakeFilling(Compound, mindeg, maxdeg,
tol2d, tol3d, nbiter) #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object)->GEOM_Object
Sewing = geompy.MakeSewing([Face, S], precision) #(List Of GEOM_Object, Double)->GEOM_Object

Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS