POV-Ray : Newsgroups : povray.newusers : Bend a Wire Server Time
1 Nov 2024 04:13:47 EDT (-0400)
  Bend a Wire (Message 1 to 5 of 5)  
From: Chrisir
Subject: Bend a Wire
Date: 5 Feb 2011 15:00:00
Message: <web.4d4dab93eeb4a9f15d8c9b080@news.povray.org>
Hello all,

I want to show a bend wire.

I should look like a looping.

I have a list of 386 vectors/points I want to use.

First I went for using sphere_sweep.

But the problem is, that I need a rather thin wire.

So when I decrease the radius of the spheres (.14), you can see the single
spheres which is bad.
I would need a thin wire that looks smooth without spheres.

Second I tried

#declare MySpline =
  spline {
    cubic_spline

and then went thru it with a "while" to paint the sphere.
Same problem of course.

Then I went thru it with a "while" to paint cylinders (from MySpline (ctr) to
MySpline (ctr+1) )
but then it says, you can't use cylinder because
top and apex-vector are the same (which they are not, only if rounded).

I tried to catch the cylinders that are the same with "if"...
still bad...

So my question is: Is there a real wire or mesh I can use to take care of my
points?

Besides, my 386 vector-data also is slightly zig-zag, you can see it, when
radius is small (0.14); I'd like to smoothen that too (tesselation?).

Thank you very much

Chrisir


Post a reply to this message

From: Jim Holsenback
Subject: Re: Bend a Wire
Date: 5 Feb 2011 16:11:59
Message: <4d4dbd1f$1@news.povray.org>
On 02/05/2011 03:57 PM, Chrisir wrote:
> I want to show a bend wire.
> 
> I should look like a looping.

have a look in povray.text.scene-files for t_coil.inc I recently used it
to make springs used with an vintage microphone ... hope it helps!


Post a reply to this message

From: stbenge
Subject: Re: Bend a Wire
Date: 5 Feb 2011 17:41:46
Message: <4d4dd22a@news.povray.org>
On 2/5/2011 1:11 PM, Jim Holsenback wrote:
> On 02/05/2011 03:57 PM, Chrisir wrote:
>> I want to show a bend wire.
>>
>> I should look like a looping.
>
> have a look in povray.text.scene-files for t_coil.inc I recently used it
> to make springs used with an vintage microphone ... hope it helps!

There's also the rounded_lsweep macro to make (fixed radius) wires of 
any shape. I've updated the file to support autofitting, but don't think 
I ever uploaded it. I guess I've found something to do today, after all <g>.

Sam


Post a reply to this message

From: Alain
Subject: Re: Bend a Wire
Date: 6 Feb 2011 21:45:52
Message: <4d4f5ce0$1@news.povray.org>

>
>
> Hello all,
>
> I want to show a bend wire.
>
> I should look like a looping.
>
> I have a list of 386 vectors/points I want to use.
>
> First I went for using sphere_sweep.
>
> But the problem is, that I need a rather thin wire.
>
> So when I decrease the radius of the spheres (.14), you can see the single
> spheres which is bad.
> I would need a thin wire that looks smooth without spheres.
>
> Second I tried
>
> #declare MySpline =
>    spline {
>      cubic_spline
>
> and then went thru it with a "while" to paint the sphere.
> Same problem of course.
>
> Then I went thru it with a "while" to paint cylinders (from MySpline (ctr) to
> MySpline (ctr+1) )
> but then it says, you can't use cylinder because
> top and apex-vector are the same (which they are not, only if rounded).
>
> I tried to catch the cylinders that are the same with "if"...
> still bad...
>
> So my question is: Is there a real wire or mesh I can use to take care of my
> points?
>
> Besides, my 386 vector-data also is slightly zig-zag, you can see it, when
> radius is small (0.14); I'd like to smoothen that too (tesselation?).
>
> Thank you very much
>
> Chrisir
>
>
>
>
>

A sphere_sweep can take any radius, even negative, without breaking 
appart as disjuncted spheres.

If you want to use a string of distinct spheres, as you decrease the 
radius, you need to use an insane number of individual spheres. In that 
case, you are beter using many cylinders and connect them with spheres 
of the same radius. If a cylinder's end points are the same, keep the 
first point and skip to the next point in the list, continue untill you 
have a non-zero length.
If you want to be realy fancy, and ready to do some mathematics, you can 
use many torus segments.

The error you had with the spline was due to degenerate cylinders. 
Prevent that by prolonging the spline beyond the end points of the part 
you want to use, and add some test to skip zero length cases. It also 
help controll the path near the extremities.

For the unintended zig-zag thing, changing the spline type of a spline 
may hide some of it. Keep in mind that that zig-zag could be a good 
thing as it will make your whire less "perfect" and can give it a used look.



Alain


Post a reply to this message

From: Chrisir
Subject: Re: Bend a Wire
Date: 27 Feb 2011 06:55:01
Message: <web.4d6a3a8f5996ffec22dbc4580@news.povray.org>
> A sphere_sweep can take any radius, even negative, without breaking
> appart as disjuncted spheres.


Hello,

thanks, Alain, that was very helpful.

I had an error in my initial data for the looping.

It wasn't the fault of sphere_sweep; you are right.

Thank you so much!

Chrisir


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.