Add-In Critique: Polyhedron Generator

Add-In Critique: Polyhedron Generator

Anonymous
Not applicable
2,307 Views
9 Replies
Message 1 of 10

Add-In Critique: Polyhedron Generator

Anonymous
Not applicable

I recently came across the polyhedron viewer website http://dmccooey.com/polyhedra/ and was inspired to make an add-in that would take the shape information and make a polyhedron solid in Fusion.

 

I've created an add-in that seems to work well for me: https://github.com/e-z-E/Polyhedron-Fusion-AddIn

 

I'm looking for general feedback and suggestions for improvement.  Eventually I'd like to share this for free in the app store. It seems like the hobbyist 3d printer community could get enjoyment from this.

 

I've attached just a few example images of shapes that are available, but there are hundreds of options.

 

Please check it out and share your thoughts!

2,308 Views
9 Replies
Replies (9)
Message 2 of 10

JeromeBriot
Mentor
Mentor

Hello,

 

Good job.

 

Here are some instructions to group items in the timeline:

 

1) Get the Timeline object from the design:

timeline = design.timeline

2) Get the first position:

timeline_start = timeline.markerPosition

3) Get the last position and create the group:

# Create timeline group for all operations
timeline_end = timeline.markerPosition
timeline.timelineGroups.add(timeline_start, timeline_end-1)

I had to use "timeline_end-1" to make it works. Maybe it's a bug?

 

Message 3 of 10

kandennti
Mentor
Mentor

Wonderful.

I once made a macro in CATIA that uses the data from that site to create a shape.

https://grabcad.com/library/visual_polyhedra_import-macro-1 

However, I couldn't process up to this point because I didn't know how to get the website data with VBA.

 

Respect to you.

0 Likes
Message 4 of 10

Anonymous
Not applicable

Thanks for the timeline tip! I gave up quickly trying to figure out the grouping before, but I'm thinking the "-1" for timeline_end must have been the missing trick.

0 Likes
Message 5 of 10

OldSchoolMakerD
Explorer
Explorer

I built something similar to this as a programming experiment, but ran into problems with profiles, surfaces, and stitching.  This solved things for me, so thanks!

 

My code was hardcoding icosahedron faces, so I took your "for each face" loop functions and applied them to mine.  While it's functional, I found that for an icosahedron (20-sided), it was generating 211 bodies.  That's 210 "face" bodies, plus one assembled one at the end.  The magic number 210 is 1+2+3+4...+20. 

 

I think the reason is that you're setting up profiles_collection outside the for loop (line 299), accumulating profiles as each face is added (line 320, profiles_collection.add()), and passing the full set of accumulated profiles when calling patches.createInput (line 323).  Given the current construct, I think it's easiest if you just precede the "for each profile in sketch.profiles" thing with "profile_collections.clear()".  The alternative (probably more costly) is to move the profiles_collection construction inside the for loop.

0 Likes
Message 6 of 10

Anonymous
Not applicable

Hmm.. that is interesting behavior. When I run the code for an icosahedron I only get the 20 surface, plus the 1 solid body. I'm not sure what would be causing the difference.

0 Likes
Message 7 of 10

OldSchoolMakerD
Explorer
Explorer
My mistake. I missed that you're actually declaring the profile collection
twice, once on 299 outside the loop, and again on 307 inside the loop. I
didn't see the one inside the loop, but by missing that line in my variant,
I ended up with too many bodies. The one on 307 gives you an empty
profiles collection on each face. You probably can remove the declaration
on line 299.
0 Likes
Message 8 of 10

sameeryel
Community Visitor
Community Visitor

@Anonymous Really great Add-on! I was wondering if you would be able to make it self contained without dependency on the external website. I am a designer and use your add on rather frequently. I just want this add-on to function forever.

0 Likes
Message 9 of 10

MichaelT_123
Advisor
Advisor

Hi  Mr Sameeryel,

 

Please consider to look here:

https://forums.autodesk.com/t5/fusion-360-design-validate/platonic-solids/td-p/8438153

 

Regards

MichaelT

 

MichaelT
Message 10 of 10

Anonymous
Not applicable

Hi Sameeryel,

 

I'm glad you've found the add-in to be useful. I probably won't be making changes to code, though I do understand your worries about websites disappearing over time. 

 

If you wanted to, you could download the shape files you are interested in keeping, then use the custom weblink box to input a path to that file on your local disk with the format "file:C:\(your path here)\Cube.txt". Look for the 'coordinates' button to access the .txt file on the website.

 

You would also need to comment out lines 222-226 in the add-in code. Those lines check that inputs are connecting to the correct website, which we would want to ignore in this scenario. 

 

I hope that helps!

0 Likes