sapit.d3m (stick a pin in it) - for DesignCAD earth model

Started by prl, April 10, 2014, 12:31:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

Here is a silly routine that I decided to write.  It goes back to the earth texture modeling we were discussing in March 2014.


'program:  sapit.d3m  (stick a pin in it)

'forum topic - http://forum.designcad.com/index.php?topic=5449.msg36777#msg36777

status = sys(242)

'for the DesignCAD earth model.dcd
r = 10
pin = 2
r2 = r+pin

sys(80)=0

input "Enter latitude in decimal degrees format", lat
input "Enter longitude in decimal degrees format", lon

'unit vector - remember DesignCAD reverses Y and Z,  XZ plane is the equator.
x1 = cos(lat) * cos(lon)
z1 = cos(lat) * sin(lon)
y1 = sin(lat)

sys(242)=1
>Cone
{
<Color 0, 255, 0
<Layer 2
<Nface 12
<Orientation 0
<pointxyz [0,0,0]
<pointxyz [.2,0,0]
<pointxyz [0,pin,0]
}

>sethandle
{
<type 0
<pointxyz [0,0,0]
<pointxyz [0,pin,0]
}

>move
{
<reference 0
<type 1
<pointxyz [r2*x1,r2*y1,r2*z1]
<pointxyz [r*x1,r*y1,r*z1]
}

sys(242)=status
sys(80)=0
sys(1)=0
regen
End