|
GHS Port Reference Center
Information for maritime designers, engineers and builders Maintained by Creative Systems, Inc., Creators of GHS Click here for information about GHS and other fine marine software. |
|
|
proj cyltank
`Demonstrates making a cylindrical tank with convex spherical ends.
macro cyltank `Params: Name, Long, Trans, CylBot, CylTop, Diam
.diam %6
enter pm
create %1
cylinder(12) %2, %3, %4, %2, %3, %5, {diam}
comp top
.sphere %3, %5
bottom %5
vector %2, 0, 0
comp bottom
.sphere %3, %4
top %4
vector %2, 0, 0
//
write {project}.gf
quit `pm
/
macro sphere
inboard -99
cylinder 0, %1, %2, {r}, %1, %2
diam .1 @ -{r}
diam {d1}
diam {d2}
diam {d3}
diam {d4}
diam {d5}
diam {d6}
diam {d7}
diam {d8}
diam {d9}
diam .1 @ {r}
/
macro diam
variables diam,r,r2,x,x2,t
variables (string) d1,d2,d3,d4,d5,d6,d7,d8,d9
set diam = %1 `Diameter of the tank
macro d
set x = %%92 times {r}
set x2 = {x} times {x}
set t = {r2} minus {x2}
set t = sqrt {t}
set t = {t} plus {t}
set d%%91 = "{t} @ {x}"
//
set r = {diam} DIV 2
set r2 = {r} times {r}
.d 1 -0.90
.d 2 -0.75
.d 3 -0.50
.d 4 -0.25
.d 5 0.00
.d 6 0.25
.d 7 0.50
.d 8 0.75
.d 9 0.90
/
clear
enter pm
`Make a hull -- any hull will do.
create hull
ends 0 100
top 10
bot 0
out 10
/
write {project}.gf
quit `pm
` %1 %2 %2 %4 %5 %6
`------- Name ---- Long -- Trans -- Vert@CylBot & CylTop -- Diameter
.cyltank tank1.s, 50.0, 5.5, 3.50, 6.50, 3.0
.cyltank tank2.p, 60.0, 5.5, 3.50, 6.50, 4.0
display
load (*) 1.0
status tank
|
| Add a free link to your site |