[Question] Code 3d for rotation


Hi, someone can tell me the 3D code for rotate the diagonal face? Solid created with command "prism". Thank you.

Attachments (1)

Type: image/jpeg
Downloaded 35 times
Size: 645,35 KiB

Show most helpful answer Hide most helpful answer

Have a look at the smartpart "Test.smt"

Master-Script:
eps=0.00001
x = TAN ( c ) * a / 2

Parameter-Script:
VALUES c RANGE [-atan(b/(a/2)),atan(b/(a/2))]

3D-Script:
HANDLE b , 0 , 0 , id , "c" , 4
HANDLE b + x , 0 , 0 , id , "c" , 5
HANDLE b , a / 2 , 0 , id , "c" , 6 + 1024
HANDLE 0 , 0 , 1 , id , "c" , 7

PUT 0 , 0
PUT b + x , 0
PUT b - x , a
PUT 0 , a
PUT 0 , 0

PRISM NUM_SP / 2 , s ,
GET ( NUM_SP )

Attachments (1)

Type: text/xml
Downloaded 747 times
Size: 8,94 KiB

Hello,

You have (just) to calculate the position of the moved points...
This is a geometry issue, not a code issue.


Quote by Bertrand_C
Ciao,
Devi (solo) calcolare la posizione dei punti spostati ...

Questo è un problema di geometria, non un problema di codice.

Thank you for your specification but maybe I didn't explain myself well ...I meant the code for "handle" of rotation.

Have a look at the smartpart "Test.smt"

Master-Script:
eps=0.00001
x = TAN ( c ) * a / 2

Parameter-Script:
VALUES c RANGE [-atan(b/(a/2)),atan(b/(a/2))]

3D-Script:
HANDLE b , 0 , 0 , id , "c" , 4
HANDLE b + x , 0 , 0 , id , "c" , 5
HANDLE b , a / 2 , 0 , id , "c" , 6 + 1024
HANDLE 0 , 0 , 1 , id , "c" , 7

PUT 0 , 0
PUT b + x , 0
PUT b - x , a
PUT 0 , a
PUT 0 , 0

PRISM NUM_SP / 2 , s ,
GET ( NUM_SP )

Attachments (1)

Type: text/xml
Downloaded 747 times
Size: 8,94 KiB

Quote by Nemo
Have a look at the smartpart "Test.smt"
Master-Script:

eps=0.00001

x = TAN ( c ) * a / 2
Parameter-Script:

VALUES c RANGE [-atan(b/(a/2)),atan(b/(a/2))]
3D-Script:

HANDLE b , 0 , 0 , id , "c" , 4
HANDLE b + x , 0 , 0 , id , "c" , 5
HANDLE b , a / 2 , 0 , id , "c" , 6 + 1024

HANDLE 0 , 0 , 1 , id , "c" , 7
PUT 0 , 0
PUT b + x , 0

PUT b - x , a

PUT 0 , a
PUT 0 , 0
PRISM NUM_SP / 2 , s ,
GET ( NUM_SP )


Hi Nemo, this is the code I was looking for. Thank you for help! Goodbye.

https://campus.allplan.com/ uses cookies  -  More information

Accept