-
Notifications
You must be signed in to change notification settings - Fork 3
Elements and Interactions #56
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
Conversation
tomvanmele
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- geometric definition of simple elements seems unnecessarily complicated (why not use a box to define the base geometry of a beam and column?)
- aabb, obb, collision mesh are expected to be in model geometry
- please use a formatter
| raise ValueError("Modifier type is not defined, please define a modifier type e.g. SlicerModfier.") | ||
|
|
||
| if issubclass(modifier_type, BooleanModifier): | ||
| return BooleanModifier(self.elementgeometry.transformed(self.modeltransformation)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is self.elementgeometry.transformed(self.modeltransformation) not the same as self.modelgeometry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not want here to trigger the cache.
| def _create_slicer_modifier(self, target_element: "BeamElement") -> Modifier: | ||
| mesh = self.elementgeometry.transformed(self.modeltransformation) | ||
| center_line = target_element.center_line.transformed(target_element.modeltransformation) | ||
|
|
||
| p0 = center_line.start | ||
| p1 = center_line.end | ||
|
|
||
| closest_distance_to_end_point = float("inf") | ||
| closest_face = 0 | ||
| for face in self.elementgeometry.faces(): | ||
| polygon = mesh.face_polygon(face) | ||
| frame = polygon.frame | ||
| result = intersection_line_plane(center_line, Plane.from_frame(frame)) | ||
| if result: | ||
| point = Point(*result) | ||
| xform = Transformation.from_frame_to_frame(frame, Frame.worldXY()) | ||
| point = point.transformed(xform) | ||
| polygon = polygon.transformed(xform) | ||
| if is_point_in_polygon_xy(point, polygon): | ||
| d = max(p0.distance_to_point(point), p1.distance_to_point(point)) | ||
| if d < closest_distance_to_end_point: | ||
| closest_distance_to_end_point = d | ||
| closest_face = face | ||
|
|
||
| plane = Plane.from_frame(mesh.face_polygon(closest_face).frame) | ||
| plane = Plane(plane.point, -plane.normal) | ||
| return SlicerModifier(plane) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you not just define the cutting plane using the box frame in model coordinates and the information about the connectivity about the beams?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to do Mesh and Ray (center-line) collision here, to use it for inclined cases too.
Elements: beam, column, plate and interactions types: contact, collision, modifier.
What type of change is this?
Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.mdfile in theUnreleasedsection under the most fitting heading (e.g.Added,Changed,Removed).invoke test).invoke lint).compas.datastructures.Mesh.