POV-Ray : Newsgroups : povray.newusers : Profile along curve. Yes? Server Time
28 Apr 2024 20:45:01 EDT (-0400)
  Profile along curve. Yes? (Message 1 to 8 of 8)  
From: LanuHum
Subject: Profile along curve. Yes?
Date: 6 Sep 2013 14:30:00
Message: <web.522a1df14a0a92a17a3e03fe0@news.povray.org>
Sphere_sweep: sphere along b-spline?
If yes: how make box_sweep or prism_sweep, or other profile?
For example:
http://yadi.sk/d/eJafyasE8qMeT


Post a reply to this message

From: James Holsenback
Subject: Re: Profile along curve. Yes?
Date: 6 Sep 2013 14:51:11
Message: <522a241f$1@news.povray.org>
On 09/06/2013 02:24 PM, LanuHum wrote:
> Sphere_sweep: sphere along b-spline?
> If yes: how make box_sweep or prism_sweep, or other profile?
> For example:
> http://yadi.sk/d/eJafyasE8qMeT
>
>
>

// define the points
#declare Pt1 = <1.5,1,0>;
#declare Pt2 = <1,1,0>;
#declare Pt3 = <1,0.5,0>;
#declare Pt4 = <2,0.5,0>;
#declare Pt5 = <2,2,0>;
#declare Pt6 = <0,2,0>;
#declare Pt7 = <0,0,0>;
#declare Pt8 = <3,0,0>;
#declare Pt9 = <1,6,0>;
#declare PtA = <2.5,6.5,0>;
#declare PtB = <6,4.87,0>;

// create the shape (profile)
#declare TableLegShape =
spline {
natural_spline
	0/10 Pt1
	1/10 Pt2
	2/10 Pt3
	3/10 Pt4
	4/10 Pt5
	5/10 Pt6
	6/10 Pt7
	7/10 Pt8
	8/10 Pt9
	9/10 PtA
	10/10 PtB
	}

// the shape that will follow the profile
#declare TableLegSegment =
union {
	sphere {0,0.1 translate z*0.125}
	cylinder {<0,0,-0.125>, <0,0,0.125>, 0.1}
	sphere {0,0.1 translate -z*0.125}
	}

// the final shape
#declare TableLeg =
#declare ctr = 0;
union {
	#while (ctr < 1)
		object { TableLegSegment rotate z*0
			translate TableLegShape (ctr)
			}
		#declare ctr = ctr + 0.00025;
	#end
	}


Post a reply to this message

From: LanuHum
Subject: Re: Profile along curve. Yes?
Date: 7 Sep 2013 01:50:01
Message: <web.522abda7b097185d7a3e03fe0@news.povray.org>
James Holsenback <nom### [at] nonecom> wrote:

>
> // create the shape (profile)
> #declare TableLegShape =
> spline {
> natural_spline
>  0/10 Pt1
>  1/10 Pt2
>  2/10 Pt3
>  3/10 Pt4
>  4/10 Pt5
>  5/10 Pt6
>  6/10 Pt7
>  7/10 Pt8
>  8/10 Pt9
>  9/10 PtA
>  10/10 PtB
>  }
>

>
> // the final shape
> #declare TableLeg =
> #declare ctr = 0;
> union {
>  #while (ctr < 1)
>   object { TableLegSegment rotate z*0
>    translate TableLegShape (ctr)
>    }
>   #declare ctr = ctr + 0.00025;
>  #end
>  }

Thank you, very good! :)
But, 2 more question:
sphere_sweep use spline point radius. This is transform scale from a point to a
point.
Example:
 sphere_sweep {
    linear_spline // spline type
    4, /7 number of <x,y,z> points, radius
    <-1.50, 1.00,-0.5>, 0.25
    <-1.50, 0.00, 1>, 0.15
    < 0.50, 0.00, 0>, 0.35
    < 1.50, 0.50, 2>, 0.15
1.How it make in while?
2.What define numbers in spline 0/10, 1/10 and so on???


Post a reply to this message

From: James Holsenback
Subject: Re: Profile along curve. Yes?
Date: 7 Sep 2013 08:08:47
Message: <522b174f$1@news.povray.org>
On 09/07/2013 01:46 AM, LanuHum wrote:
> James Holsenback <nom### [at] nonecom> wrote:
>
>>
>> // create the shape (profile)
>> #declare TableLegShape =
>> spline {
>> natural_spline
>>   0/10 Pt1
>>   1/10 Pt2
>>   2/10 Pt3
>>   3/10 Pt4
>>   4/10 Pt5
>>   5/10 Pt6
>>   6/10 Pt7
>>   7/10 Pt8
>>   8/10 Pt9
>>   9/10 PtA
>>   10/10 PtB
>>   }
>>
>
>>
>> // the final shape
>> #declare TableLeg =
>> #declare ctr = 0;
>> union {
>>   #while (ctr < 1)
>>    object { TableLegSegment rotate z*0
>>     translate TableLegShape (ctr)
>>     }
>>    #declare ctr = ctr + 0.00025;
>>   #end
>>   }
>
> Thank you, very good! :)
> But, 2 more question:
> sphere_sweep use spline point radius. This is transform scale from a point to a
> point.
> Example:
>   sphere_sweep {
>      linear_spline // spline type
>      4, /7 number of <x,y,z> points, radius
>      <-1.50, 1.00,-0.5>, 0.25
>      <-1.50, 0.00, 1>, 0.15
>      < 0.50, 0.00, 0>, 0.35
>      < 1.50, 0.50, 2>, 0.15
> 1.How it make in while?

if i'm understanding correctly ... load the values into an array

> 2.What define numbers in spline 0/10, 1/10 and so on???

trial and error ... i have home-made include file (splinelab) that helps 
mark where the points are ... in this case the shape of a wrought iron 
table leg

have a look at 
http://wiki.povray.org/content/Documentation:Tutorial_Section_3#Spline_Based_Shapes 
if you haven't already. that's were i got the idea for creating 
splinelab to help with defining the curve. if by hand is too tedious for 
you look at http://www.povray.org/ under POV-RAY related news ... i 
posted a link there a while ago (lathe and prism utility)


Post a reply to this message

From: LanuHum
Subject: Re: Profile along curve. Yes?
Date: 10 Sep 2013 12:30:00
Message: <web.522f471eb097185d7a3e03fe0@news.povray.org>
James Holsenback <nom### [at] nonecom> wrote:

>
> have a look at
> http://wiki.povray.org/content/Documentation:Tutorial_Section_3#Spline_Based_Shapes
> if you haven't already. that's were i got the idea for creating
> splinelab to help with defining the curve. if by hand is too tedious for
> you look at http://www.povray.org/ under POV-RAY related news ... i
> posted a link there a while ago (lathe and prism utility)

My purpose - creation of asymmetrical objects for Boolean operations using the
Blender-3D tools
Sphere_sweep is available now. It can be used for Boolean operations now.
The while(cycle) also will be available.
But, it would be desirable to operate scale,
to manipulate scale along curve,
constraint scale to curve point radius
Blender have parameter: vertices radius.
I use it in sphere_sweep.
I want to learn: how to use it in a while(cycle)?
Probably, I will divide a cycle(while) into some parts...


Post a reply to this message

From: LanuHum
Subject: Re: Profile along curve. Yes?
Date: 5 Jan 2014 10:35:00
Message: <web.52c97a22b097185d7a3e03fe0@news.povray.org>
Hi.
Sorry!
I created the file in blender with object sphere_sweep:

global_settings {
    assumed_gamma 1
    max_trace_level 3
}
background {rgbt<0.0509, 0.0509, 0.0509, 0>}
#declare NurbsCurve =
sphere_sweep { cubic_spline 10,
    <-1.796,-0.2653,0.5108>,0.2,
    <-1.627,-0.8928,0.7868>,0.2,
    <0.01627,-1.644,-0.4275>,0.2,
    <1.422,-0.6246,-2.678>,0.2,
    <-0.6351,0.9274,-1.604>,0.2,
    <-1.659,0.5656,-0.2417>,0.2,
    <-1.5,0,0>,0.2,
    <-1,-4.371e-08,-1>,0.2,
    <1,-4.371e-08,-1>,0.2,
    <1.5,0,0>,0.2
    texture {pigment{rgb 0.8}}
    scale <1,1,1>
    rotate <-2.504e-06,-0,0>
    translate <0.000000, 0.000000, 0.000000>
}
object {NurbsCurve}
light_source {
    <4.08,5.9,-1.01>
    color rgb<1, 1, 1>
}
#declare Camera_Location = <7.481132, 5.343666, 6.507640>;
#declare Camera_Look_At = <0, 0, -1>;
#declare Camera_Angle = 49.134343;
#include "transforms.inc"
#declare Cam_V = Camera_Look_At - Camera_Location;
#declare Cam_Ho = sqrt(pow(Cam_V.x,2)+pow(Cam_V.z ,2));
#declare Cam_Y = Camera_Look_At.y - Camera_Location.y;
camera {
    angle  Camera_Angle
    right <-1.6077777759896383, 0, 0>
    location  <0,Camera_Look_At.y,-Cam_Ho>
    matrix<1,0,0, 0,1,0, 0,Cam_Y/Cam_Ho,1, 0,0,0>
    Reorient_Trans(z,<Cam_V.x,0,Cam_V.z>)
    translate<Camera_Look_At.x+2,1.25,Camera_Look_At.z+2>
}

Render good: object in scene

Now I want to use coordinates NurbsCurve for while
I use an example from James Holsenback in this topic:

global_settings {
    assumed_gamma 1
    max_trace_level 3
}
background {rgbt<0.0509, 0.0509, 0.0509, 0>}

#declare TableLegShape =
spline {
cubic_spline
 0/10 <-1.796,-0.2653,0.5108>
 1/10 <-1.627,-0.8928,0.7868>
 2/10 <0.01627,-1.644,-0.4275>
 3/10 <1.422,-0.6246,-2.678>
 4/10 <-0.6351,0.9274,-1.604>
 5/10 <-1.659,0.5656,-0.2417>
 6/10 <-1.5,0,0>
 7/10 <-1,-4.371e-08,-1>
 8/10 <1,-4.371e-08,-1>
 9/10 <1.5,0,0>
 }

// the shape that will follow the profile
#declare TableLegSegment =
union {
 sphere {0,0.1 translate z*0.125}
 cylinder {<0,0,-0.125>, <0,0,0.125>, 0.1}
 sphere {0,0.1 translate -z*0.125}
 }

// the final shape
#declare TableLeg =
#declare ctr = 0;
union {
 #while (ctr < 1)
  object { TableLegSegment rotate z*0
   translate TableLegShape (ctr)
   }
  #declare ctr = ctr + 0.00025;
 #end
 }

light_source {
    <4.08,5.9,-1.01>
    color rgb<1, 1, 1>
}
#declare Camera_Location = <7.481132, 5.343666, 6.507640>;
#declare Camera_Look_At = <0, 0, -1>;
#declare Camera_Angle = 49.134343;
#include "transforms.inc"
#declare Cam_V = Camera_Look_At - Camera_Location;
#declare Cam_Ho = sqrt(pow(Cam_V.x,2)+pow(Cam_V.z ,2));
#declare Cam_Y = Camera_Look_At.y - Camera_Location.y;
camera {
    angle  Camera_Angle
    right <-1.6077777759896383, 0, 0>
    location  <0,Camera_Look_At.y,-Cam_Ho>
    matrix<1,0,0, 0,1,0, 0,Cam_Y/Cam_Ho,1, 0,0,0>
    Reorient_Trans(z,<Cam_V.x,0,Cam_V.z>)
    translate<Camera_Look_At.x+2,1.25,Camera_Look_At.z+2>
}

Object NOT in scene!
Help me, please!
Thanks!


Post a reply to this message

From: Fractracer
Subject: Re: Profile along curve. Yes?
Date: 5 Jan 2014 14:35:01
Message: <web.52c9b2d0b097185d9d0caeb40@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> Hi.
> Sorry!
>
> Now I want to use coordinates NurbsCurve for while
> I use an example from James Holsenback in this topic:
>
> global_settings {
>     assumed_gamma 1
>     max_trace_level 3
> }
> background {rgbt<0.0509, 0.0509, 0.0509, 0>}
>
> #declare TableLegShape =
> spline {
> cubic_spline
>  0/10 <-1.796,-0.2653,0.5108>
>  1/10 <-1.627,-0.8928,0.7868>
>  2/10 <0.01627,-1.644,-0.4275>
>  3/10 <1.422,-0.6246,-2.678>
>  4/10 <-0.6351,0.9274,-1.604>
>  5/10 <-1.659,0.5656,-0.2417>
>  6/10 <-1.5,0,0>
>  7/10 <-1,-4.371e-08,-1>
>  8/10 <1,-4.371e-08,-1>
>  9/10 <1.5,0,0>
>  }
>
> // the shape that will follow the profile
> #declare TableLegSegment =
> union {
>  sphere {0,0.1 translate z*0.125}
>  cylinder {<0,0,-0.125>, <0,0,0.125>, 0.1}
>  sphere {0,0.1 translate -z*0.125}
>  }
>
 Your final object is only here. You do add a line after the declaration.

> // the final shape
> #declare TableLeg =
> #declare ctr = 0;
> union {
>  #while (ctr < 1)
>   object { TableLegSegment rotate z*0
>    translate TableLegShape (ctr)
>    }
>   #declare ctr = ctr + 0.00025;
>  #end
>  }
>
ex here:
object {
     TableLeg
}

> light_source {
>     <4.08,5.9,-1.01>
>     color rgb<1, 1, 1>
> }
> #declare Camera_Location = <7.481132, 5.343666, 6.507640>;
> #declare Camera_Look_At = <0, 0, -1>;
> #declare Camera_Angle = 49.134343;
> #include "transforms.inc"
> #declare Cam_V = Camera_Look_At - Camera_Location;
> #declare Cam_Ho = sqrt(pow(Cam_V.x,2)+pow(Cam_V.z ,2));
> #declare Cam_Y = Camera_Look_At.y - Camera_Location.y;
> camera {
>     angle  Camera_Angle
>     right <-1.6077777759896383, 0, 0>
>     location  <0,Camera_Look_At.y,-Cam_Ho>
>     matrix<1,0,0, 0,1,0, 0,Cam_Y/Cam_Ho,1, 0,0,0>
>     Reorient_Trans(z,<Cam_V.x,0,Cam_V.z>)
>     translate<Camera_Look_At.x+2,1.25,Camera_Look_At.z+2>
> }
>


Post a reply to this message

From: LanuHum
Subject: Re: Profile along curve. Yes?
Date: 6 Jan 2014 11:30:01
Message: <web.52cad9acb097185d7a3e03fe0@news.povray.org>
"Fractracer" <lg.### [at] gmailcom> wrote:

> >
> ex here:
> object {
>      TableLeg
> }

Oh!
Thanks!
My delusion:
#declare ctr = 0;
union {
I badly a sign with the sintaksy While
Sorry!
Thanks!


Post a reply to this message

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