Skip to content

Commit

Permalink
Updates for bevel tool (#462)
Browse files Browse the repository at this point in the history
* Updates for bevel tool
Adds coincident constraints if startpoint has an attached reference.
Also adds construction lines/arcs to the reference startpoint.

* Only set coincident to lines, not arcs
  • Loading branch information
TimStrauven authored Apr 29, 2024
1 parent 1476235 commit 892dff5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 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,19 @@ 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:
# add reference construction lines and coincidents
sse = context.scene.sketcher.entities
for i in range(0, 2):
if isinstance(self.connected[i], SlvsLine2D):
ssc.add_coincident(point, self.connected[i], sketch)
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 892dff5

Please sign in to comment.