Skip to content

Commit

Permalink
updates (minor) to sketching from origin point
Browse files Browse the repository at this point in the history
  • Loading branch information
ooMICAHoo committed Jun 27, 2018
1 parent 1f14974 commit 9e55c67
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions op_polytrim/polytrim_datastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,6 @@ def make_sketch(self, hovered_start, sketch_data, view_vector):
hover_end = hovered_end[1]
view_vectors = [view_vector]*len(sketch_data)

## Non-manifold sketches to or from a non-man edge/vert first
print("start:",hovered_start)
print("end:",hovered_end)
# ending on non manifold edge/vert
if hovered_end[0] and "NON_MAN" in hovered_end[0]:
self.points_data += sketch_data + [{"world_location": hovered_end[1][1], "view_direction": view_vector}]
Expand All @@ -348,13 +345,15 @@ def make_sketch(self, hovered_start, sketch_data, view_vector):
self.points_data += sketch_data
self.start_edge = hovered_start[1][0]

## then manifold sketches

#User is not connecting back to polyline
elif hovered_end[0] != 'POINT':
# Do nothing if...
if self.cyclic or self.end_edge: pass

# starting at last point
elif hover_start == len(self.points_data) - 1:
self.points_data += sketch_data

# starting at origin point
elif hover_start == 0:
# origin point is start edge
Expand All @@ -363,10 +362,6 @@ def make_sketch(self, hovered_start, sketch_data, view_vector):
else:
self.points_data = sketch_data[::-1] + self.points_data[:]

# starting at last point
elif hover_start == len(self.points_data) - 1:
self.points_data += sketch_data

# starting in the middle
else: #if the last hovered was not the endpoint of the polyline, need to trim and append
self.points_data = self.points_data[:hover_start] + sketch_data
Expand Down Expand Up @@ -1842,7 +1837,7 @@ def draw(self,context):

## Origin Point
if self.points_data[0]:
common_drawing.draw_3d_points(context,[self.points_data[0]["world_location"]], 10, (1,.8,.2,1))
common_drawing.draw_3d_points(context,[self.points_data[0]["world_location"]], 8, (1,.8,.2,1))

## Selected Point
if self.selected != -1 and len(self.points_data) >= self.selected + 1:
Expand Down

0 comments on commit 9e55c67

Please sign in to comment.