POV-Ray : Newsgroups : povray.binaries.images : LanuHum, I cannot convert bezier spline to cubic spline Server Time
29 Apr 2024 17:41:38 EDT (-0400)
  LanuHum, I cannot convert bezier spline to cubic spline (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 13:50:00
Message: <web.55d0ccbba4f6ca688423d9aa0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> "And" <49341109@ntnu.edu.tw> wrote:
> > Another picture:
>
> It gives to hope!

Oh, this is just like Cousin Ricky's sphere sweep macro. I spend some time
studying it. Thanks to him.

This is not the 'sphere_sweep' object of povray, it just a union. The union
contains some spheres and cylinders.


If you want to add to your scene:

//-------------------------------
#include "bezier_spheresweep.inc"

#declare my_bezier_points =
array[8]{
<0, 0, 0>, <0.2, 0.3, 0.1>, <0.6, 0.1, 0>, <1, 0, 0>,
<1, 0, 0>, <1, -0.5, 0>, <1.2, -0.5, 0.5>, <1.6, -0.6, 0.8>
}





object{
Shape_Bezierpoints_Sphere_Sweep(20, my_bezier_points, 0.02)
    pigment{rgb<0.1,0.2,0.2>}
}


Post a reply to this message

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 15:25:08
Message: <web.55d0e350a4f6ca687a3e03fe0@news.povray.org>
Something doesn't coincide.:(
#version 3.7;

#include "shapes.inc"
#include "functions.inc"
global_settings {
    assumed_gamma 1.000000
}
sky_sphere {
    pigment {rgb<0.050, 0.050, 0.050>}
}

#declare Default_texture = texture{pigment {rgb 0.8}}

#declare Material = texture{
    pigment{color rgbft <0.8000,0.0127,0.0332,0.0000,0.0000>}
}
#declare Material_001 = texture{
    pigment{color rgbft <0.0123,0.0084,0.8000,0.0000,0.0000>}
}
#declare Material_002 = texture{
    pigment{color rgbft <0.0803,0.8000,0.0184,0.0000,0.0000>}
}
#declare Material_003 = texture{
    pigment{color rgbft <0.6392,0.8000,0.5126,0.0000,0.0000>}
}
#declare data_Cylinder_shape_002_ob = cylinder { <0,0,1>,<0,0,-1>,1
}
#declare data_Cylinder_shape_001_ob = cylinder { <0,0,1>,<0,0,-1>,1
}
#declare data_Cylinder_shape_ob = cylinder { <0,0,1>,<0,0,-1>,1
}
union {
}
#declare BezierCurve_bezier_points = array[8]{
    <-1,0><-0.5,0.5><0,0><1,0>
    <1,0><2,0><-0.2001,0.2996><0.7999,0.2996>
}
#include "bezier_spheresweep.inc"
#declare data_BezierCurve_ob = object{Shape_Bezierpoints_Sphere_Sweep(20,
BezierCurve_bezier_points, 0.02)
    texture {Material_003}
}
object {data_Cylinder_shape_002_ob
    texture {Material}
    matrix <-0.000000, -0.000000, -0.034897,  0.000000, 0.034897, -0.000000,
14.249066, -0.000001, -0.000001,  0.000000, 0.000000, 0.000000>
}

object {data_Cylinder_shape_001_ob
    texture {Material_002}
    matrix <0.034897, 0.000000, 0.000000,  0.000000, 0.034897, 0.000000,
0.000000, 0.000000, 10.180943,  0.000000, 0.000000, 0.000000>
}

object {data_Cylinder_shape_ob
    texture {Material_001}
    matrix <0.034897, 0.000000, 0.000000,  0.000000, -0.000000, -0.034897,
0.000000, 3.339409, -0.000000,  0.000000, 0.000000, 0.000000>
}

object {data_BezierCurve_ob
    texture {Material_003}
    matrix <4.031789, 0.000000, 0.000000,  0.000000, 2.190180, -3.385031,
0.000000, 3.385031, 2.190180,  0.000000, 0.000000, 0.000000>
}

light_source {
    <5.07,5.58,4.28>
    color rgb<1, 1, 1>
    fade_distance 25.0000000000
    fade_power 1
}
camera {
    perspective
    location  <0,0,0>
    look_at  <0,0,-1>
    right <-1.7777777777777777, 0, 0>
    up <0, 1, 0>
    angle  49.134343
    rotate  <-27.098163, 46.688390, -0.903519>
    translate <7.481132, 5.343666, 6.507640>
}


Post a reply to this message


Attachments:
Download 'bezier_sweep.blend.jpg' (80 KB)

Preview of image 'bezier_sweep.blend.jpg'
bezier_sweep.blend.jpg


 

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 16 Aug 2015 22:40:01
Message: <web.55d148eea4f6ca688423d9aa0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> Something doesn't coincide.:(
> #version 3.7;
>
> #include "shapes.inc"
> #include "functions.inc"
> global_settings {
>     assumed_gamma 1.000000
> }
> sky_sphere {
>     pigment {rgb<0.050, 0.050, 0.050>}
> }
>
> #declare Default_texture = texture{pigment {rgb 0.8}}
>
> #declare Material = texture{
>     pigment{color rgbft <0.8000,0.0127,0.0332,0.0000,0.0000>}
> }
> #declare Material_001 = texture{
>     pigment{color rgbft <0.0123,0.0084,0.8000,0.0000,0.0000>}
> }
> #declare Material_002 = texture{
>     pigment{color rgbft <0.0803,0.8000,0.0184,0.0000,0.0000>}
> }
> #declare Material_003 = texture{
>     pigment{color rgbft <0.6392,0.8000,0.5126,0.0000,0.0000>}
> }
> #declare data_Cylinder_shape_002_ob = cylinder { <0,0,1>,<0,0,-1>,1
> }
> #declare data_Cylinder_shape_001_ob = cylinder { <0,0,1>,<0,0,-1>,1
> }
> #declare data_Cylinder_shape_ob = cylinder { <0,0,1>,<0,0,-1>,1
> }
> union {
> }
> #declare BezierCurve_bezier_points = array[8]{
>     <-1,0><-0.5,0.5><0,0><1,0>
>     <1,0><2,0><-0.2001,0.2996><0.7999,0.2996>
> }
> #include "bezier_spheresweep.inc"
> #declare data_BezierCurve_ob = object{Shape_Bezierpoints_Sphere_Sweep(20,
> BezierCurve_bezier_points, 0.02)
>     texture {Material_003}
> }
> object {data_Cylinder_shape_002_ob
>     texture {Material}
>     matrix <-0.000000, -0.000000, -0.034897,  0.000000, 0.034897, -0.000000,
> 14.249066, -0.000001, -0.000001,  0.000000, 0.000000, 0.000000>
> }
>
> object {data_Cylinder_shape_001_ob
>     texture {Material_002}
>     matrix <0.034897, 0.000000, 0.000000,  0.000000, 0.034897, 0.000000,
> 0.000000, 0.000000, 10.180943,  0.000000, 0.000000, 0.000000>
> }
>
> object {data_Cylinder_shape_ob
>     texture {Material_001}
>     matrix <0.034897, 0.000000, 0.000000,  0.000000, -0.000000, -0.034897,
> 0.000000, 3.339409, -0.000000,  0.000000, 0.000000, 0.000000>
> }
>
> object {data_BezierCurve_ob
>     texture {Material_003}
>     matrix <4.031789, 0.000000, 0.000000,  0.000000, 2.190180, -3.385031,
> 0.000000, 3.385031, 2.190180,  0.000000, 0.000000, 0.000000>
> }
>
> light_source {
>     <5.07,5.58,4.28>
>     color rgb<1, 1, 1>
>     fade_distance 25.0000000000
>     fade_power 1
> }
> camera {
>     perspective
>     location  <0,0,0>
>     look_at  <0,0,-1>
>     right <-1.7777777777777777, 0, 0>
>     up <0, 1, 0>
>     angle  49.134343
>     rotate  <-27.098163, 46.688390, -0.903519>
>     translate <7.481132, 5.343666, 6.507640>
> }

union{
    sphere{
    <-1,0>, 0.05
    }
    sphere{
    <1,0>, 0.05
    }

    sphere{
    <1,0>, 0.05
    }
    sphere{
    <0.7999,0.2996>, 0.05
    }
    pigment{rgb 0.5}
    matrix <4.031789, 0.000000, 0.000000,  0.000000, 2.190180,
-3.385031,0.000000, 3.385031, 2.190180,  0.000000, 0.000000, 0.000000>
}



??

I'm not sure what causes this, but I drew some spheres in addition, it fits the
terminals of the curve. Or you actually drew three dimension coordinates but you
output just two dimension coordinate data?


Post a reply to this message


Attachments:
Download 'bezier_sweep_test2.png' (78 KB)

Preview of image 'bezier_sweep_test2.png'
bezier_sweep_test2.png


 

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 17 Aug 2015 13:10:01
Message: <web.55d21491a4f6ca687a3e03fe0@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
>
> I'm not sure what causes this, but I drew some spheres in addition, it fits the
> terminals of the curve. Or you actually drew three dimension coordinates but you
> output just two dimension coordinate data?

I don't understand.
Two spheres coincide with coordinates.
The third sphere doesn't coincide.

#version 3.7;

#include "shapes.inc"
#include "functions.inc"
global_settings {
    assumed_gamma 1.000000
}
sky_sphere {
    pigment {rgb<0.050, 0.050, 0.050>}
}

#declare Default_texture = texture{pigment {rgb 0.8}}

#declare Material = texture{
    pigment{color rgbft <0.0485,0.8000,0.0262,0.0000,0.0000>}
}
#declare Material_001 = texture{
    pigment{color rgbft <0.8000,0.0068,0.1947,0.0000,0.0000>}
}
#declare Material_002 = texture{
    pigment{color rgbft <0.0107,0.0259,0.8000,0.0000,0.0000>}
}
#declare Material_003 = texture{
    pigment{color rgbft <0.0227,0.8000,0.0175,0.0000,0.0000>}
}
#declare Material_004 = texture{
    pigment{color rgbft <0.8000,0.0196,0.0155,0.0000,0.0000>}
}
#declare data_Cylinder_shape_002_ob = cylinder { <0,0,1>,<0,0,-1>,1
}
#declare data_Cylinder_shape_001_ob = cylinder { <0,0,1>,<0,0,-1>,1
}
#declare data_Cylinder_shape_ob = cylinder { <0,0,1>,<0,0,-1>,1
}
#declare data_Sphere_shape_002_ob = sphere { 0,1
}
#declare data_Sphere_shape_001_ob = sphere { 0,1
}
#declare data_Sphere_shape_ob = sphere { 0,1
}
union {
}
#declare BezierCurve_bezier_points = array[8]{
    <-1,0><-0.5,0.5><0,0><1,0>
    <1,0><2,0><1.025,2.45><2.025,2.45>
}
#include "bezier_spheresweep.inc"
#declare data_BezierCurve_ob = object{Shape_Bezierpoints_Sphere_Sweep(20,
BezierCurve_bezier_points, 0.02)
    texture {Material_001}
}
object {data_Cylinder_shape_002_ob
    texture {Material_004}
    matrix <-0.000000, -0.035411, 0.000000,  0.000000, -0.000000, -0.035411,
17.995750, -0.000001, 0.000000,  0.000000, 0.000000, 0.000000>
}

object {data_Cylinder_shape_001_ob
    texture {Material_003}
    matrix <0.035411, 0.000000, 0.000000,  0.000000, 0.035411, 0.000000,
0.000000, 0.000000, 19.020086,  0.000000, 0.000000, 0.000000>
}

object {data_Cylinder_shape_ob
    texture {Material_002}
    matrix <0.035411, 0.000000, 0.000000,  0.000000, -0.000000, -0.035411,
0.000000, 13.345572, -0.000001,  0.000000, 0.000000, 0.000000>
}

object {data_Sphere_shape_002_ob
    texture {Material}
    matrix <0.203845, 0.000000, 0.000000,  0.000000, -0.000000, -0.203845,
0.000000, 0.203845, -0.000000,  2.025354, 1.852481, -2.450227>
}

object {data_Sphere_shape_001_ob
    texture {Material}
    matrix <0.203845, 0.000000, 0.000000,  0.000000, -0.000000, -0.203845,
0.000000, 0.203845, -0.000000,  1.000000, 0.000000, 0.000000>
}

object {data_Sphere_shape_ob
    texture {Material}
    matrix <0.203845, 0.000000, 0.000000,  0.000000, -0.000000, -0.203845,
0.000000, 0.203845, -0.000000,  -1.000000, 0.000000, 0.000000>
}

object {data_BezierCurve_ob
    texture {Material_001}
    matrix <1.000000, 0.000000, 0.000000,  0.000000, -0.000000, -1.000000,
0.000000, 1.000000, -0.000000,  0.000000, 0.000000, 0.000000>
}

light_source {
    <5.07,5.58,4.28>
    color rgb<1, 1, 1>
    fade_distance 25.0000000000
    fade_power 1
}
camera {
    perspective
    location  <0,0,0>
    look_at  <0,0,-1>
    right <-1.7777777777777777, 0, 0>
    up <0, 1, 0>
    angle  49.134343
    rotate  <-27.098163, 46.688390, -0.903519>
    translate <7.481132, 5.343666, 6.507640>
}


Post a reply to this message


Attachments:
Download 'bezier_sweep.jpg' (188 KB)

Preview of image 'bezier_sweep.jpg'
bezier_sweep.jpg


 

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 17 Aug 2015 14:10:00
Message: <web.55d22270a4f6ca687a3e03fe0@news.povray.org>
:)
Oh,I forgot to bind the third coordinate Z!
Sorry! Sorry! Sorry!

It is good to change thickness in each control point, as in official
sphere_sweep,


Post a reply to this message


Attachments:
Download 'good_bezier_sweep.jpg' (28 KB)

Preview of image 'good_bezier_sweep.jpg'
good_bezier_sweep.jpg


 

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 17 Aug 2015 14:20:05
Message: <web.55d2251da4f6ca688423d9aa0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:

> union {
> }
> #declare BezierCurve_bezier_points = array[8]{
>     <-1,0><-0.5,0.5><0,0><1,0>
>     <1,0><2,0><1.025,2.45><2.025,2.45>
> }

The problem is: Your bezier curve points in Blender is three dimension, but when
you export them, you only output x and y, in other word 2d points.
A 3D point in pov-ray should be like this: <1.0, 0.2, 1.0>

A 2D point in pov-ray is like this: <1.0, 0.2>


Post a reply to this message

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 17 Aug 2015 14:25:05
Message: <web.55d22668a4f6ca688423d9aa0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> :)
> Oh,I forgot to bind the third coordinate Z!
> Sorry! Sorry! Sorry!
>
> It is good to change thickness in each control point, as in official
> sphere_sweep,

Good.


Post a reply to this message

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 17 Aug 2015 14:25:09
Message: <web.55d226e2a4f6ca688423d9aa0@news.povray.org>
I would like to sleep now.


Post a reply to this message

From: LanuHum
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 17 Aug 2015 14:40:05
Message: <web.55d229d6a4f6ca687a3e03fe0@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
> I would like to sleep now.

Good night! :)
Thank you!

Now I can create CSG:
difference{
object {Bezier_prism}
object {Bezier_sweep}
}


Post a reply to this message


Attachments:
Download 'diff.jpg' (31 KB)

Preview of image 'diff.jpg'
diff.jpg


 

From: And
Subject: Re: LanuHum, I cannot convert bezier spline to cubic spline
Date: 18 Aug 2015 06:45:01
Message: <web.55d30b97a4f6ca6826e996a60@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> "And" <49341109@ntnu.edu.tw> wrote:
> > I would like to sleep now.
>
> Good night! :)
> Thank you!
>
> Now I can create CSG:
> difference{
> object {Bezier_prism}
> object {Bezier_sweep}
> }

Ok! The sky is dark again.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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