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

Unexpected Brep trimming behavior #25

Open
chenkasirer opened this issue Mar 4, 2024 · 2 comments
Open

Unexpected Brep trimming behavior #25

chenkasirer opened this issue Mar 4, 2024 · 2 comments

Comments

@chenkasirer
Copy link
Member

When trimming Brep using brep.trimmed() getting an unexpected result compared to Rhino. Specifically, the portion of the brep that is cut away is the one at the opposite direction of the plane's normal. In Rhino, the portion at the direction of the normal is cut.

To Reproduce

  from compas.geometry import Box, Line, Plane, Brep, Point, Vector
  brep = Brep.from_box(Box(xsize=2, ysize=0.1, zsize=0.2))
  plane = Plane(point=Point(x=0.5, y=0.0, z=0.0), normal=Vector(x=0.923, y=-0.382, z=0.0) * -1.0)
  result = brep.trimmed(plane)

  viewer = Viewer(rendermode="ghosted")
  # viewer.add(brep)
  viewer.add(result)
  viewer.add(plane)
  viewer.add(Line(plane.point, plane.point + plane.normal))
  viewer.show()

Expected behavior

I would expect the the portion trimmed away is always where the plane's normal is pointing and documented it accordingly in the RhinoBrep implementation.

However, if this is not the desired maybe we can discuss and agree on a consistent convention?

Screenshots

image

Desktop (please complete the following information):

  • compas_occ==1.01
  • OS: Windows
  • Python 3.12
  • Conda
@chenkasirer
Copy link
Member Author

I think this should be the opposite:

if is_point_infrontof_plane(point, plane):
occ_shape = test
break

as it was before:
e3ee66c

@tomvanmele
Copy link
Member

should be solved now. will release new version soon...

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

2 participants