Skip to content

Commit

Permalink
Updates for bevel tool
Browse files Browse the repository at this point in the history
Adds coincident constraints if startpoint has an attached reference.
Also adds construction lines/arcs to the reference startpoint.
  • Loading branch information
TimStrauven committed Apr 20, 2024
1 parent d018d09 commit a3ff967
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions operators/bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from bpy.props import FloatProperty

from ..model.types import SlvsPoint2D
from ..model.types import SlvsLine2D
from ..model.types import SlvsArc
from ..utilities.constants import HALF_TURN
from ..utilities.view import refresh
from ..solver import solve_system
from ..utilities.data_handling import is_entity_referenced
Expand Down Expand Up @@ -135,6 +138,21 @@ def fini(self, context, succeede):
# Remove original point if not referenced
if not is_entity_referenced(point, context):
context.scene.sketcher.entities.remove(point.slvs_index)
else:
ssc.add_coincident(point, seg1, sketch)
ssc.add_coincident(point, seg2, sketch)

# add reference construction lines
sse = context.scene.sketcher.entities
for i in range(0, 2):
if isinstance(self.connected[i], SlvsLine2D):
target = sse.add_line_2d(point, self.points[i], sketch)
target.construction = True
elif isinstance(self.connected[i], SlvsArc):
target = sse.add_arc(sketch.wp.nm, self.connected[i].ct, self.points[i], point, sketch)
target.construction = True
if target.angle > HALF_TURN:
target.invert_direction = True

refresh(context)
solve_system(context)
Expand Down

0 comments on commit a3ff967

Please sign in to comment.