Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCCUtils, Common, point_in_solid Function Issue #24

Open
Vahid44 opened this issue Dec 23, 2020 · 0 comments
Open

OCCUtils, Common, point_in_solid Function Issue #24

Vahid44 opened this issue Dec 23, 2020 · 0 comments

Comments

@Vahid44
Copy link

Vahid44 commented Dec 23, 2020

Hello everyone, and hope for your well-being.

I faced a problem when I tried to use the point_in_solid function from OCCUtils.
Actually, sometimes when I use this function with a shape (indeed it is an IfcSpace) and a point (which I know is inside the shape), it returns "False" (as the point is not in the shape!!).

Does anyone know what the problem is? Actually, I test this function with several points and several shapes and I do not know why it returns erroneous values.
One more thing; what is the geometry data that defines a TopoDS_Shape?! Is that a Mesh that surrounds the shape?
Thank you.

import ifcopenshell
import ifcopenshell.geom
import OCC.Core
from OCCUtils.Common import point_in_solid
from OCC.Core.gp import gp_Pnt, gp_Vec, gp_Trsf

ifc_file = ifcopenshell.open(r'C:\Users\PATH\MyProject3.ifc')
space = ifc_file.by_guid('1YaheuayH6kBI6D9$zc5YL')

settings = ifcopenshell.geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)

product = ifcopenshell.geom.create_shape(settings, space)
aShape = OCC.Core.TopoDS.TopoDS_Shape(product.geometry)

thePoint = gp_Pnt(2.6644,-0.5839,15)

print(point_in_solid(aShape, thePoint))      ### Should return True, but returns False!

Here is the out put of the code:
Capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant