POV-Ray : Newsgroups : povray.general : Sweep Mesh Macro request Server Time
1 Aug 2024 02:21:06 EDT (-0400)
  Sweep Mesh Macro request (Message 1 to 8 of 8)  
From: gregjohn
Subject: Sweep Mesh Macro request
Date: 8 Jun 2006 21:40:00
Message: <web.4488d0e1a03939c710c13190@news.povray.org>
I would like a macro which is like Mike Williams' sweep spline, only with
this added feature.  My  motivation is for character modelling
(http://flickr.com/photos/pterandon/91637417/ ).

The current macro has a circular cross section all the way through it.  What
I would like is one that allows for assymetric ellispses  or other closed
splines along its path.

Here's one possible set of inputs:
i) a spline of N points
ii) a array of N elements, each of which is a four dimensional vector, and
those four data represent the length away from the center of the spline in
i), only in the (if I'm saying it right) +u, -u, +v, and -v axes.  Right
now the macro returns what I'm calling u and v as all being a constant
radius from the center.

Here's another possible input set:
i) Four splines of N points, and you can count on the user being fairly
responsible in not having them cross over each other.  Between point N-a
and N-b, the macro returns, well, something like that in the first example.

Here's another possible input set:
i) a spline of N points
ii) an array of M elements, each of which is a closed loop spline of L
points.  As the mesh is built, the Closed Loop is swept out along the
spline in i).

Thanks in advance.


Post a reply to this message

From: Mike Williams
Subject: Re: Sweep Mesh Macro request
Date: 8 Jun 2006 22:48:42
Message: <+qUMVAAm$NiEFwPW@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>I would like a macro which is like Mike Williams' sweep spline, only with
>this added feature.  My  motivation is for character modelling
>(http://flickr.com/photos/pterandon/91637417/ ).
>
>The current macro has a circular cross section all the way through it.

It's only a circle if you pass it a circular "Shape" spline. You can use
any spline, open or closed, for the cross section.

>  What
>I would like is one that allows for assymetric ellispses  or other closed
>splines along its path.
>
>Here's one possible set of inputs:
>i) a spline of N points
>ii) a array of N elements, each of which is a four dimensional vector, and
>those four data represent the length away from the center of the spline in
>i), only in the (if I'm saying it right) +u, -u, +v, and -v axes.  Right
>now the macro returns what I'm calling u and v as all being a constant
>radius from the center.
>
>Here's another possible input set:
>i) Four splines of N points, and you can count on the user being fairly
>responsible in not having them cross over each other.  Between point N-a
>and N-b, the macro returns, well, something like that in the first example.
>
>Here's another possible input set:
>i) a spline of N points
>ii) an array of M elements, each of which is a closed loop spline of L
>points.  As the mesh is built, the Closed Loop is swept out along the
>spline in i).
>
>Thanks in advance.

Can you explain one of those in a bit more detail? I can't seem to work
out what you're getting at.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: gregjohn
Subject: Re: Sweep Mesh Macro request
Date: 9 Jun 2006 11:45:00
Message: <web.4489971a98b40c8240d56c170@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it gregjohn who wrote:
> >I would like a macro which is like Mike Williams' sweep spline, only with
> >this added feature.  My  motivation is for character modelling
> >(http://flickr.com/photos/pterandon/91637417/ ).
> >
> >The current macro has a circular cross section all the way through it.
>
> It's only a circle if you pass it a circular "Shape" spline. You can use
> any spline, open or closed, for the cross section.
>



Okay thanks for the clarification. I've used the macro often to make
polygonal (I guess they ain't circles) cross sections but I guess I hadn't
peeked under the hood as much as I should have.

I guess I'm thinking about the ability to *change* the closed-loop spline
for the section as you go along the path.


I am thinking of making a head +neck + torso.   Imagine a slice at the nose,
at the chin, at the neck, at the pecs, at the belt.  You could define a
closed loop macro of five points (or ten) at each slice.   Then, if one
merely animates the spline which forms the spine, you've got a completely
animatable character created purely in povray.  This is my dream.

I might be able to program this myself, but I have made gross errors when
programming such a thing.

Thanks.


Post a reply to this message

From: Charles C
Subject: Re: Sweep Mesh Macro request
Date: 9 Jun 2006 13:50:01
Message: <web.4489b46898b40c82200a56120@news.povray.org>
Wow we think alike!  I'm using a similar strategy on a character I'm working
on.   I think you'll end up with a collectin of re-usable macros as well
ones which are specific to a body part.   I'm using an array of 4d vectors
just like you mentioned.  E.g:


#declare Tail_Array_Lev0_Num0 =
array[23]{
  <0 ,-3.00, 0.10,   -1/20> //tangent
  <0 ,-3.00,-0.00,    0/20> //bottom

  <0 ,-2.95,-1.00,    1/20>
  <0 ,-2.50,-2.00,    2/20>
  <0 ,-1.60,-2.50,    3/20>
  <0 ,-0.50,-2.50,    4/20>
  <0 , 0.25,-2.30,    5/20>

  <0 , 0.85,-1.90,    6/20>
  <0 , 1.40,-1.20,    7/20>
  <0 , 1.70,-0.60,    8/20>
  <0 , 1.82,-0.35,    9/20>

  <0 , 2.00, 0.00,   10/20> //top

  <0 , 1.82, 0.35,   11/20>
  <0 , 1.70, 0.60,   12/20>
  <0 , 1.40, 1.20,   13/20>
  <0 , 0.85, 1.90,   14/20>

  <0 , 0.25, 2.30,   15/20>
  <0 ,-0.50, 2.50,   16/20>
  <0 ,-1.60, 2.50,   17/20>
  <0 ,-2.50, 2.00,   18/20>
  <0 ,-2.95, 1.00,   19/20>

  <0 ,-3.00, 0.00,   20/20> //bottom
  <0 ,-3.00,-0.10,   21/20> //tangent
} // end spline Tail_Array_Lev0_Num0

//Plot_Spline_From_Array(Tail_Array_Lev0_Num0, no, 0, 23, 0, 1, Red, 2)


I've been working slowly on my skeletal system but I just finished that at
the end of May and haven't had a chance to work much since.

Anyway I'll be using:
1. a minimal handful of hand-coded spline cross sections, albeit entered
using arrays of 4d vectors so that they can be oriented to the character's
position and especially the character's spine.
2. a macro which turns an array of 4d vectors into a spline.
3. a macro which creates a spline from a defined point on each of several
other splines. That creates a single longitudinal sline. It can also be
used to create blending-splines from limb to body for example.
4. a macro which loops with calls to the macro defined in #3 to create any
number of longitudinal splines.
5. macros which uses existing spline data to find the orientation of this
surface we're defining to place scales or hair along the longitudinal
splines
6. a simple macro to "lace" any two splines together with a mesh of
triangles, i.e. skin where necessary.
7. special purpose macros to assemble everything.

There will be plenty of special-purpose macros for joining body parts
smoothly.  It'll likely be impractical to pass all the needed information
to a general purpose macro, but we'll see.  Since I'm using an all-bone
based skeletin (my spine is not based on a spline... it happens to have 75
vertebrae counting the head) I won't be sliding splines along other splines
until I start working on teeth horns and toe-nails.


Charles


Post a reply to this message

From: ingo
Subject: Re: Sweep Mesh Macro request
Date: 11 Jun 2006 05:31:14
Message: <Xns97DF7530A897Aseed7@news.povray.org>
in news:web.4489971a98b40c8240d56c170@news.povray.org gregjohn wrote:

> I guess I'm thinking about the ability to *change* the closed-loop
> spline for the section as you go along the path.

Have a look at Striscia, it's old but may still suit your needs.
http://news.povray.org/Xns94D4AF6BE46A0seed7@news.povray.org

It would be nice if somebody rewrote it for use with the inbuilt 
splines...
 
> I am thinking of making a head +neck + torso.   Imagine a slice at
> the nose, at the chin, at the neck, at the pecs, at the belt.  You
> could define a closed loop macro of five points (or ten) at each
> slice.   Then, if one merely animates the spline which forms the
> spine, you've got a completely animatable character created purely in
> povray.  This is my dream. 

Maybe my MSM.inc will do to some extent what you need, it builds a 
surface from several splines. http://members.home.nl/seedseven/#msm

Ingo


Post a reply to this message

From: gregjohn
Subject: Re: Sweep Mesh Macro request
Date: 11 Jun 2006 20:55:00
Message: <web.448cbb4998b40c82710c13190@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:

> Maybe my MSM.inc will do to some extent what you need, it builds a
> surface from several splines. http://members.home.nl/seedseven/#msm
>

Cool stuff.  I think that this is AFAICS lacking a "neck-bending" feature to
it. If I were to make a stack of splines from say head to torso, there's no
way to bend the neck easily as would be in Mike's current macro.



> Have a look at Striscia, it's old but may still suit your needs.
> http://news.povray.org/Xns94D4AF6BE46A0seed7@news.povray.org
> It would be nice if somebody rewrote it for use with the inbuilt
> splines...


Okay will look.  It's going to take a little bit more time to figure out.


Post a reply to this message

From: gregjohn
Subject: Re: Sweep Mesh Macro request
Date: 11 Jun 2006 23:15:01
Message: <web.448cdb2298b40c82710c13190@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:
> I would like a macro which is like Mike Williams' sweep spline, only with
> this added feature....


Mike, in all honesty, I cannot find the version of your macro with the
spline as waist, instead of waist as spline.

In other words, all the ones I've been using over the years apparently have:

     #local W = vlength(Waist(su).x);

which AFAICS is merely a call of the x coordinate to get a radius-->
circular section.


Post a reply to this message

From: Mike Williams
Subject: Re: Sweep Mesh Macro request
Date: 11 Jun 2006 23:42:30
Message: <KZWx5MApIOjEFwSC@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>"gregjohn" <pte### [at] yahoocom> wrote:
>> I would like a macro which is like Mike Williams' sweep spline, only with
>> this added feature....
>
>
>Mike, in all honesty, I cannot find the version of your macro with the
>spline as waist, instead of waist as spline.
>
>In other words, all the ones I've been using over the years apparently have:
>
>     #local W = vlength(Waist(su).x);
>
>which AFAICS is merely a call of the x coordinate to get a radius-->
>circular section.

The "Waist" spline controls how the size of the cross section varies
along the track. The shape of the cross section is defined by the
"Shape" spline. 

After calculating
     #local P = Track(su);
     #local W = vlength(Waist(su).x);

A pair of vectors perpendicular to the track are multiplied by W

     #local DRX = W*vnormalize(vcross(DR,DRY));
     #local DRY = W*vnormalize(vcross(DRX,DR));

Then the cross sectional shape is applied to those vectors

     P + (Shape(sv).x)*DRX + (Shape(sv).y)*DRY;

Observe that "su" is the distance along the track, and "sv" is the
distance round the cross section.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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