Skip to content

Commit

Permalink
Add option to remove_inner_edges() from a specific sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBangar committed Jun 13, 2024
1 parent 8afad5f commit 20c94bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions examples/shape/cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
cylinder.set_end_patch("outlet")
cylinder.set_outer_patch("walls")

# if curved core edges get in the way (when moving vertices, optimization, ...),
# remove them with this method:
cylinder.remove_inner_edges(start=False, end=True)

bl_thickness = 0.05
core_size = 0.2

Expand Down
11 changes: 8 additions & 3 deletions src/classy_blocks/construct/shapes/round.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,17 @@ def set_outer_patch(self, name: str) -> None:
for operation in self.shell:
operation.set_patch(self.outer_patch, name)

def remove_inner_edges(self) -> None:
def remove_inner_edges(self, start: bool = True, end: bool = True) -> None:
"""Removes spline edges from cylinders.
This needs to be done in cases where any of the start/end plane points will move
(due to optimization or manual adjustments)."""
for face in (*self.sketch_1.core, *self.sketch_2.core):
face.remove_edges()
if start:
for face in self.sketch_1.core:
face.remove_edges()

if end:
for face in self.sketch_2.core:
face.remove_edges()


class RoundHollowShape(RoundSolidShape):
Expand Down

0 comments on commit 20c94bb

Please sign in to comment.