How do i call subroutine in animation / onclick?
-
I have a component which rolls on a track. I have been using a formula for intersection of line-circle and line-line to change the component coords at each increment of the animation in Sketchup Pro 7. Works great.
The formula's are in the enclosing component which holds the sub-components like wheels,track etc.
With onclick I calculate the coords with every increment of the animation. Unfortunately I have separate intersection calculations for each sub-component and it is getting messy.
I would like to implement something like Line_Line_intersect(ParmIN, ParmOUT) & Line_Circle_Intersect(ParmIN,ParmOUT) which I would call in my IF().. statement.
I scanned ruby but it is not clear to me that this is possible. Surprised I couldn't find a clear answer to this anywhere.
skyfish
-
I restructured the code and changed the algorithm. Now I can create rolling elements by
- copying typical component
- make unique
- renaming
- change offset
If you would like to see example, I have attached a file.
skyfish
EDIT:
Oops, now I remember the problem with this algorithm. The
distance between balls is a measure of the curved path. It
doesn't maintain a rigid connection between balls. Going
around the curve, the inter-distance is slightly small.
-
Since I am not getting any replies about subroutines, I did restructure again so that I can copy DC and make a few changes to produce a component that maintains distances.
The example would work for a garage door ( using ASIN & ACOS for angles ).
The calculations were adapted from
http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/
http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/There are some weird bugs in sketchup when using large numbers, in addition to the SQRT problems.
skyfish
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement