Seeking suggestions: inserting complex non-trivial shapes that are still parametric

Seeking suggestions: inserting complex non-trivial shapes that are still parametric

OceanHydroAU
Collaborator Collaborator
617 Views
2 Replies
Message 1 of 3

Seeking suggestions: inserting complex non-trivial shapes that are still parametric

OceanHydroAU
Collaborator
Collaborator

I'm inserting a sketch that does lots of computations to determine the final output shape (an airfoil).  Ultimately, it's a spline that wraps around lots of points.

 

I want users to be able to change things (e.g. the length of the chord line) - but in so doing, my math needs to run and re-compute the complex new shape that needs to replace the old one...

 

I've hooked the events needed etc and my math runs OK, so now I'm wondering what's the best approach to make the needed changes?  I can't just "delete the shape and insert a new one" (I assume, I've not actually tried yet) because I expect that will break their design (e.g. if they've extruded or lofted from the original spline, Fusion will be unhappy if I delete that).  On this idea though - perhaps there's a way to work that out, do the delete, then update whatever references got broken in that process?  Anyone know?

 

I had one crazy idea to define my shapes in relative terms to some known point (e.g. the nose of the chord line), so I then can merely update all the dimensions - this kind-of works, but is *agonizingly* slow.

 

Another idea might be to try and find all the original points I inserted, and programmatically move them to new places - it might work, but could hit snags (e.g. if the user has added constrained rails or something).

 

Or... well... that's why I'm posting: maybe there's other accepted ways for an API to "change stuff it did in the past" to respect the parametric awesomeness that is Fusion 360?

 

Thanks for any and all hints/tips/ideas you might have!

 

Example: effect of scale on ideal wing shape:- 1 meter

Screen Shot 2020-08-20 at 4.29.59 pm.png

Identical operating conditions, 10x smaller:-  0.1 meter 

Screen Shot 2020-08-20 at 4.31.11 pm.png

Accepted solutions (1)
618 Views
2 Replies
  • API
Replies (2)
Message 2 of 3

nnikbin
Collaborator
Collaborator
Accepted solution

Hi @OceanHydroAU 

 

This article and this article from @BrianEkins describe a solution for these kinds of problems which is similar your own suggested solution (using dimensions and parameters - creating points relative to origin in these articles).

 

At the end of his first article, @BrianEkins also suggests using the API to move the points to the desired location  (again like what you mentioned). So both of your methods seems to be logical solutions.

Have you tried using Sketch.isComputeDeferred to improve the performance of your solutions?

Message 3 of 3

OceanHydroAU
Collaborator
Collaborator

Sketch.isComputeDeferred !! awesome - that's the missing link that solves my problem (funny how that answer arrives here, but not in other questions and searches I've made looking for it in the past - so glad it did though 🙂

0 Likes