Hello all,
I am experiencing a problem where the call to DeterminePosition systematically returns with eOutside tInvalid ArchElementTypes.
Context : I have to check, prior to inserting an opening, if the insertion point of the opening is actually contained in the 3D geometry of its parent
Action : For this, I made the method "is_contained_in_parent" as below
def is_contained_in_parent(self, placement_matrix: AllplanGeo.Matrix3D, parent: AllplanElementAdapter) -> bool:
"""
Find if opening insertion point is contained or not in parent
Args:
parent: name of the element in which the opening is to be placed
placement_matrix: matrix describing the placement of the opening
Returns:
Boolean: True if contained else False
"""
if parent.GetArchElementType() == AllplanElementAdapter.ArchElementType.tInvalid:
geometry_3d = parent.GetModelGeometry()
else:
geometry_3d = parent.GetGeometry()
t_vec = placement_matrix.GetTranslationVector()
insertion_point = AllplanGeo.Point3D(t_vec.X, t_vec.Y, t_vec.Z)
comparison_result_3d = AllplanGeo.Comparison.DeterminePosition(geometry_3d, insertion_point, 0.0)
return False if comparison_result_3d == AllplanGeo.eComparisionResult.eOutside else True
Results : The call to the method returns systematically eOutside for tInvalid ArchElementTypes even for point located in the 3D geometry
For example, with as below parameters, DeterminePosition returns eOutside
insertion_point=Point3D(694550, 164500, -5500) and
geometry_3d : Polyhedron3D(
Type(3)
IsNegative(0)
PartsCount(1)
EdgeCount(12)
FaceCount(6)
VertexCount(
Vertices(
(691050, 167000, -6500)
(691050, 148700, -6500)
(698250, 148700, -6500)
(698250, 167000, -6500)
(691050, 167000, -5500)
(691050, 148700, -5500)
(698250, 148700, -5500)
(698250, 167000, -5500)))
Is something wrong in the way I am using DeterminePosition ?
Thanks