Skip to content

Commit

Permalink
fix: add planar decimate modifier to ring_and_bolt objects if the seg…
Browse files Browse the repository at this point in the history
…ment count is greater than 3
  • Loading branch information
tristan-hm committed Feb 5, 2022
1 parent 1ec0942 commit d92dc02
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions generators/ring_and_bolt.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ def add_screw_z_modifer(self):

self.screwZ = screwZ


def add_decimate_modifier(self):
decimate = self.obj.modifiers.new("ND — Decimate", 'DECIMATE')
decimate.decimate_type = 'DISSOLVE'
decimate.angle_limit = radians(1)

self.decimate = decimate


def operate(self, context):
self.screwX.screw_offset = self.width
Expand All @@ -163,6 +171,10 @@ def select_ring_and_bolt(self, context):

def finish(self, context):
self.select_ring_and_bolt(context)

if self.segments > 3:
self.add_decimate_modifier()

unregister_draw_handler()


Expand Down

0 comments on commit d92dc02

Please sign in to comment.