News:

The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software can be used with TurboCAD.

Main Menu

Movement part3

Started by Andy H, January 31, 2022, 06:53:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy H

Animation movement part 3,  Of about 30. but some will be combined in one animation.

This one using cam revolution.  The colours are because, I kept them the same as the plastic I printed them with.  All movements I'll post, have been printed in plastic to ensure they will work, And will eventually all be put together on an mdf board.

Rather that Maths,  This one uses an array of values, which correspond to the distance the stair needs to rise, per 6 degrees of can revolution.  As there are only 25 unique values, (the rest are either '0' or simply have a '-' sign in front of the figure). it was easier to just simulate it in 2d and measure the distance. (stair_riser1).  The custom code for this is pretty simple, and used the 'split' function of VBScript, to pass the string of values to an array. Where they are the read every 6 degrees.  The 'odst' result passed to AnimationLab move command, for stairs 1,3,5, and 7,  the 'evst' value passed to stairs 2, 4, and 6.


Dim arry ' Split Array
Dim l ' Distance lift values as string 60 values (0 to 59)
Dim odst ' lift odd stair
Dim evst ' lift even stairs
Dim t ' counter for array value
Dim t2 ' counter for array value

l = "0,0,0,0,0,0,0.1766,0.201,0.2244,0.2461,0.2673,0.285,0.3018,0.3138,0.3246," _
& "0.3291,0.3334,0.3248,0.3432,0.3629,0.3767,0.3854,0.3921,0.3935,0.3889,"_
& "0.3807,0.367,0.3371,0.2163,0.0724,-0.0724,-0.2163,-0.3371,-0.367,-0.3807," _
& "-0.3889,-0.3935,-0.3921,-0.3854,-0.3767,-0.3629,-0.3432,-0.3248,-0.3334,-0.3291," _
& "-0.3246,-0.3138,-0.3018,-0.285,-0.2673,-0.2461,-0.2244,-0.201,-0.1766,0,0,0,0,0,0"

Sub StepCustomAction

If StepNum = 0 then      ' StepNum if the frame number starting at 0.
  t = 0 ' initial set array start for odd stairs
  t2 = 30 ' initial set array start for even stairs
End If

arry = split(l,",") ' split string into an array

' ################
' The odd timer goes from 30 to 59, then 0 to 29
' The If / then Below saves using two sets of strings
' ################

If t2 = 60 then ' t2 cannot go beyond 59, or an error will occur
t2 = 0 ' reset odd timer to 0
End If

odst = arry(t) ' assign array value to odd stairs
evst =  arry(t2) ' assign array value to even stairs

t = t + 1 ' increment t value
t2 = t2 +1 ' increment t2 value

// TODO your code
end sub


Henry Hubich

That's fascinating, Andy. I have two questions:

1. How are the "odst" and "evst" results passed to the Move command?

2. What the heck IS that thing?

Henry H

Don Cheke

Quote from: Henry Hubich on January 31, 2022, 08:45:30 AM
That's fascinating, Andy. I have two questions:

1. How are the "odst" and "evst" results passed to the Move command?

2. What the heck IS that thing?

Henry H

Looks like stair risers that work like shipping cannel locks. Go up one. walk forward, go up one, walk forward.....
Don Cheke
My Blog: One Man's Meanderings

Andy H

Hi Henry.

Re - 1. How are the "odst" and "evst" results passed to the Move command?

The evst and odst (short for even stair and odd stair), are just variables.  Many commands will accept, Numbers,  formula, or a variable created in a custom script.  In this case,  If evst variable contains 0.75, The move command will delta move the object 0.75 mm upwards.

Re - 2. What the heck IS that thing?

I like Don's idea, but its not that fancy.  It is just for marbles.  YouTube has loads of marble things, but they only have one or two mechanical bits, for lifting a marble back to the top.  the rest being just rolling along some tracks. So. I thought I'd design one, which was lots of lifting or revolving, and only a few tracks.  Essentially its a pretty complicated toy.

John R

It kinda reminds me of the stairs going to my basement, while carrying a full cup of coffee.
John R.

V17—V21, 2015—2025
Designer, Deluxe, (Basic, Expert, Professional), Platinum
RedSDK enabled
Windows 11 Pro (25H2), 64-bit

PCSteel

John@PC Steel

Core i7-6700 CPU
16GB Ram
64 Bit
Windows 10 Home
TurboCAD 2015 Pro Platinum 64 bit Build 90.0
TurboCAD 2023 Platinum 64 bit Build 63.3

Henry Hubich

Quote from: Andy H on January 31, 2022, 09:13:00 AM
Hi Henry.

Re - 1. How are the "odst" and "evst" results passed to the Move command?

The evst and odst (short for even stair and odd stair), are just variables.  Many commands will accept, Numbers,  formula, or a variable created in a custom script.  In this case,  If evst variable contains 0.75, The move command will delta move the object 0.75 mm upwards.

Re - 2. What the heck IS that thing?

I like Don's idea, but its not that fancy.  It is just for marbles.  YouTube has loads of marble things, but they only have one or two mechanical bits, for lifting a marble back to the top.  the rest being just rolling along some tracks. So. I thought I'd design one, which was lots of lifting or revolving, and only a few tracks.  Essentially its a pretty complicated toy.

Ah. Thanks, Andy.

Henry H

DonCW

Quote from: Andy H on January 31, 2022, 09:13:00 AM
Hi Henry.

Re - 1. How are the "odst" and "evst" results passed to the Move command?

The evst and odst (short for even stair and odd stair), are just variables.  Many commands will accept, Numbers,  formula, or a variable created in a custom script.  In this case,  If evst variable contains 0.75, The move command will delta move the object 0.75 mm upwards.

Re - 2. What the heck IS that thing?

I like Don's idea, but its not that fancy.  It is just for marbles.  YouTube has loads of marble things, but they only have one or two mechanical bits, for lifting a marble back to the top.  the rest being just rolling along some tracks. So. I thought I'd design one, which was lots of lifting or revolving, and only a few tracks.  Essentially its a pretty complicated toy.

That looks fun stuff to design.
DonCW
2020 Platinum
2018 Platinum
2017 Pro with Light Works Plug in



Windows 10
There's so much to learn and not much time left to learn it.