0 def TestMeasureOperations (geompy, math):
27 p0 = geompy.MakeVertex(0 , 0, 0)
28 p137 = geompy.MakeVertex(10, 30, 70)
30 box = geompy.MakeBoxTwoPnt(p0, p137)
32 p678 = geompy.MakeVertex(60, 70, 80)
33 p789 = geompy.MakeVertex(70, 80, 90)
35 vz = geompy.MakeVectorDXDYDZ(0, 0, 1)
37 cube = geompy.MakeBoxTwoPnt(p678, p789)
39 cylinder = geompy.MakeCylinder(p0, vz, 5, 70)
170 MinDist = geompy.MinDistance(box, cube)
177 print(
"\nMinimal distance between Box and Cube = ", MinDist)
179 MinDistComps = geompy.MinDistanceComponents(box, cube)
180 print(
"\nMinimal distance between Box and Cube = ", MinDistComps[0])
181 print(
"Its components are (", MinDistComps[1],
", ", MinDistComps[2],
", ", MinDistComps[3],
")")
184 [nbSols, listCoords] = geompy.ClosestPoints(box, cube)
185 for i
in range(nbSols):
186 v1 = geompy.MakeVertex(listCoords[i*6 + 0], listCoords[i*6 + 1], listCoords[i*6 + 2])
187 v2 = geompy.MakeVertex(listCoords[i*6 + 3], listCoords[i*6 + 4], listCoords[i*6 + 5])
189 geompy.addToStudy(v1,
'MinDist_%d_on_Box'%(i+1))
190 geompy.addToStudy(v2,
'MinDist_%d_on_Cube'%(i+1))
195 OX = geompy.MakeVectorDXDYDZ(10, 0,0)
196 OXY = geompy.MakeVectorDXDYDZ(10,10,0)