POV-Ray : Newsgroups : povray.newusers : Profile along curve. Yes? : Re: Profile along curve. Yes? Server Time
14 May 2024 03:59:29 EDT (-0400)
  Re: Profile along curve. Yes?  
From: James Holsenback
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

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