twisted ribbon/object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-17 07:33 AM
Please show me how this (attached) is done using GDL, I have posted this in 'Working in AC' section. I got a suggestion to bring it here. I have tried the mesh tool before, but didnt work. I would also like to know if I can manipulate/play with the surface of this object after creating it.
Please disregard materials.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-17 10:19 AM
I haven't the time to noodle it out myself but it looks like a simple circular (sine) function should generate the values if the spiral is to be a regular one. Otherwise you will probably need additional parameters to introduce any distortions you want.
The SWEEP or TUBE statements are probably the best bet for the actual form. I recommend using a FOR-NEXT loop with a PUT statement to set up the coordinates and then use GET within the SWEEP or TUBE. There is some code similar to this in the manual.
Clever application of the graphical (or user) hotspots could make this into a very interesting part.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-17 04:46 PM
It was done as an exercise in one of our GDL classes here in São Paulo/Brazil.
AC 24 BR – MacBook Pro 2,9 GHz Intel Core i7 16GB RAM Mac OS 10.14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-17 08:00 PM
HTH !
Stuart 'prefers long variable names' James
!*** master variables ***
oRevolutions = 2
oSegmentAngle = 5 !=== in degrees
oCoilRadius = 5
oCoilLength = 50
oBandWidth = 5
oBandHeight = 2
!*** dependent variables ***
oAngle = 360 * oRevolutions
oStep = oAngle / (360/oSegmentAngle)
oXmultiplier = oCoilLength / oAngle
!*** put path ***
for i = 0 - oStep to oAngle + oStep step oStep
oX = i * oXmultiplier
oY = sin (i) * oCoilRadius
oZ = cos (i) * oCoilRadius
put oX, oY, oZ, i
next i
!*** draw path ***
tube 4, oAngle/oStep +2, 32+16+2+1,
-oBandWidth*0.5, -oBandHeight*0.5, 0,
oBandWidth*0.5, -oBandHeight*0.5, 0,
oBandWidth*0.5, oBandHeight*0.5, 0,
-oBandWidth*0.5, oBandHeight*0.5, 0,
get ((oAngle/oStep+2)*4)
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-18 07:56 AM
Durval, I would like to know how is it possible to make this ribbon start wide and end up thin or almost pointed. the width in the object is fixed all along.
I want it to look more like the one posted by Stuart, except for the thickness.
Stuart, please let me know how long it took you to do it?
and is that how you felt after doing it, turning around and around.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-18 02:02 PM
The 'one posted by Stuart' is an even thickness along the length. Here is a 'rough' variation which gives tapered ends. As long as you're happy with the geometry/maths this doesn't take long at all.
Note - it isn't an 'accurate' model but would suffice for many circumstances.... Now I'm curious! - just what are you trying to model???
HTH - Stuart
oRevolutions = 3
oSteps = 1000
oCoilRadius = 10
oCoilLength = 50
oBandMaxWidth = 2
oBandMaxHeight = 5
oHeight = oCoilLength/oSteps
roty 90
for j= -1 to oSteps+1
i = j/oSteps * 360 * oRevolutions
oBandWidth = oBandMaxWidth * sin(j/oSteps*180)+0.001
oBandHeight = oBandMaxHeight * sin(j/oSteps*180)+0.001
put oCoilRadius * cos(i) - oBandWidth * cos (i) + oBandHeight * sin (i),
oCoilRadius * sin(i) - oBandWidth * sin (i) - oBandHeight * cos (i), oHeight,
oCoilRadius * cos(i) + oBandWidth * cos (i) + oBandHeight * sin (i),
oCoilRadius * sin(i) + oBandWidth * sin (i) - oBandHeight * cos (i), oHeight,
oCoilRadius * cos(i) + oBandWidth * cos (i) - oBandHeight * sin (i),
oCoilRadius * sin(i) + oBandWidth * sin (i) + oBandHeight * cos (i), oHeight,
oCoilRadius * cos(i) - oBandWidth * cos (i) - oBandHeight * sin (i),
oCoilRadius * sin(i) - oBandWidth * sin (i) + oBandHeight * cos (i), oHeight,
oCoilRadius * cos(i) - oBandWidth * cos (i) + oBandHeight * sin (i),
oCoilRadius * sin(i) - oBandWidth * sin (i) - oBandHeight * cos (i), oHeight
if j>=0 and j<=oSteps then
ruled 5, 51,
get(2), get(1)*0,
get(2), get(1)*0,
get(2), get(1)*0,
get(2), get(1)*0,
get(2), get(1)*0,
use(15)
addz oHeight
endif
next j
del top[/size]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-18 04:26 PM
saif wrote:Saif;
Stuart, please let me know how long it took you to do it?
The first one took about 4 minutes (+1 minute to render). The second example took 6:30 minutes (yes I timed it! + 2 minutes to render).
But if 3d geometry isn't your cup of tea then it could take a lot lot longer...
- Stuart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-18 06:03 PM
oSe = 0300 !=== no. of segments
oCr = 0005 !=== helix diameter
oBw = 0002 !=== width of band
oAn = 1500 !=== total revolved angle
oLe = 0050 !=== total length
for j=-1 to 1 step 2 : for i=0 to oAn step oAn/oSe
put oCr*cos(i)+j*oBw*cos(i)*sin(i/oAn*180)
put oCr*sin(i)+j*oBW*sin(i)*sin (i/oAn*180)
put i/oAN*oLe
next i : next j
for i=0 to oAn step oAn : for j=0 to 1
put oCr*cos(i) : put oCR*sin(i) : put i/oAN*oLe
next j : next i
coons (nsp-12)/6, 2, 60, get (nsp)[/size]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-18 06:28 PM
StuartJames wrote:WOW! Where can I find one of these beers?
Having had a beer (:)) here's a 'better' solution...
Maybe it alows me to understand your elegant piece of code...
Up to the ruled script I was following your mathematics.
But this coons solution made me a bit lost. Could you give some clue on how you worked out these geometric equations?
AC 24 BR – MacBook Pro 2,9 GHz Intel Core i7 16GB RAM Mac OS 10.14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-11-18 07:07 PM
Durval wrote:Exactly. Give us a bit of a lesson here, Stuart! Or tell us which beer!
WOW! Where can I find one of these beers?
Maybe it alows me to understand your elegant piece of code...
Up to the ruled script I was following your mathematics.
But this coons solution made me a bit lost. Could you give some clue on how you worked out these geometric equations?
Karl
AC 28 USA and earlier • macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB