I am modeling pedestrian movement through space-time in order to address alibi queries and I am using ribbons to represent potential times-to-occupy locations in 3D space. In order to satisfy the query I need to compute the intersections of polygons in 3D space - i.e. using faces. There are two possible scenarios in the query - 1) that the ribbons are coplanar and 2) the ribbons are non-coplanar. In the case of the coplanar ribbons, I can compute the intersection of the ribbons (i.e. faces) and the results are correct (polygons/faces in 3d space). In the non-coplanar case - where faces may intersect from different planes I can calculate the intersection which should be a line in my example but I get an error that Inventor
cannot represent this shape.
Here is my code - this is just a toy example to make sure the process will work:
Code: Select all
#first face
pt1 = FreeCAD.Base.Vector(25,0,0)
pt2 = FreeCAD.Base.Vector(25,0,10)
pt3 = FreeCAD.Base.Vector(25,100,10)
pt4 = FreeCAD.Base.Vector(25,100,0)
linepart = [pt1,pt2,pt3,pt4,pt1]
poly1 = Part.makePolygon(linepart)
face3 = Part.Face(poly1)
#second face
pt5 = FreeCAD.Base.Vector(50,50,0)
pt6 = FreeCAD.Base.Vector(0,50,0)
pt7 = FreeCAD.Base.Vector(0,50,5)
pt8 = FreeCAD.Base.Vector(50,50,5)
linepart2 = [pt5,pt6,pt7,pt8,pt5]
poly2 = Part.makePolygon(linepart2)
face4 = Part.Face(poly2)
common2 = face3.common(face4)
"Cannot compute Inventor representation for the shape of Shape003". The result should be a line representing the intersection of the faces but I can't get any information about this line. Does anyone have any suggestion about returning the intersection line, point, or null if they don't intersect?
Sorry for the long question and thanks for any information,
Sincerely,
Jerry