Skip to content

Commit

Permalink
Added check if all profiles are coplanar
Browse files Browse the repository at this point in the history
  • Loading branch information
tssmith7 committed Dec 22, 2024
1 parent f4b279e commit e8cbded
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion FRCTools.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": {
"": "Useful tools for FRC design. \nhttps://github.com/4698RaiderRobotics/FRCTools/"
},
"version": "1.0.4-alpha",
"version": "1.0.5-alpha",
"runOnStartup": true,
"supportedOS": "windows|mac",
"editEnabled": true
Expand Down
21 changes: 18 additions & 3 deletions commands/Lighten/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,31 @@ def command_input_changed(args: adsk.core.InputChangedEventArgs):
# We added a profile selection
i = 0
while i < profileSelection.selectionCount:
profile = profileSelection.selection(i).entity
profile: adsk.fusion.Profile = profileSelection.selection(i).entity
existingSelection = False
for liteProf in lightenProfileList:
if liteProf.profile == profile :
# futil.log(f'Found existing profile!!!')
existingSelection = True
break
if not existingSelection:
# futil.log(f'Adding new profile to global list .. .. .')
lightenProfileList.append( LightenProfile( profile, offsetDist.value, cornerRadius.value ))
futil.log(f'Attempting to add new profile to global list .. .. .')
if len(lightenProfileList) > 0 :
existingPlane = lightenProfileList[0].profile.plane
existingPlane.transformBy( lightenProfileList[0].profile.parentSketch.transform )
newPlane = profile.plane
newPlane.transformBy( profile.parentSketch.transform )
if existingPlane.isCoPlanarTo( newPlane ) :
futil.log(f'Adding new profile to global list .. .. .')
lightenProfileList.append( LightenProfile( profile, offsetDist.value, cornerRadius.value ))
else:
futil.popup_error( f'Selected profile is not coplanar with other selected profiles.')
profileSelection.clearSelection()
for liteProf in lightenProfileList:
profileSelection.addSelection( liteProf.profile )
else:
futil.log(f'Adding new profile to empty global list .. .. .')
lightenProfileList.append( LightenProfile( profile, offsetDist.value, cornerRadius.value ))
i += 1
elif profileSelection.selectionCount < len(lightenProfileList) :
# We removed a profile selection
Expand Down

0 comments on commit e8cbded

Please sign in to comment.