Jump to content

Any Way to create a Bezier surface from a Bezier cubic curves?


3D for mortals
 Share

Recommended Posts

for simple example i have x4 Bezier CUBIC 3D curves , which connected to contour in 3D space.

What must be my steps to convert this closed contour to bezier surface with color etc?... If it possible with babylonjs.

Functionality like this will allow create lot of surfaces, what babylonjs user wish, but i can't found any docs about this.

path846.png

Link to comment
Share on other sites

Hiya 3dfm!  Check this out...

https://www.babylonjs-playground.com/#1QD8LM#4

See the 'cubicBezier' in line 67?  That's something, eh?  :)

Ribbons... breakfast of parametric shape champions.   http://doc.babylonjs.com/how_to/parametric_shapes

I found this playground via a playground search for 'bezier' and 'ribbon'.   Hope this helps.

Oh yeah, the colors.  That scares me.  BJS HAS full color-per-vertex coloring, but you may need to "insert" those Color4-like color values.... into the mesh's vertexData colorKind/colors array - doing a little paint-by-numbers with a JS func.  :)  It's part of the fun! 

http://www.babylonjs-playground.com/#1UHFAP#60

(possibly outdated - perhaps there are newer ways of interacting with vertexData)

That playground... is a little intro-to plotting mesh, vertexData, and color-per-vertex coloring.  Simple, but, full of learning, if wished.

Stay in touch and stay tuned for more/better comments.

Link to comment
Share on other sites

1 hour ago, Wingnut said:

Hiya 3dfm!  Check this out...

https://www.babylonjs-playground.com/#1QD8LM#4

See the 'cubicBezier' in line 67?  That's something, eh?  :)

Ribbons... breakfast of parametric shape champions.   http://doc.babylonjs.com/how_to/parametric_shapes

I found this playground via a playground search for 'bezier' and 'ribbon'.   Hope this helps.

Oh yeah, the colors.  That scares me.  BJS HAS full color-per-vertex coloring, but you may need to "insert" those Color4-like color values.... into the mesh's vertexData colorKind/colors array - doing a little paint-by-numbers with a JS func.  :)  It's part of the fun! 

http://www.babylonjs-playground.com/#1UHFAP#60

(possibly outdated - perhaps there are newer ways of interacting with vertexData)

That playground... is a little intro-to plotting mesh, vertexData, and color-per-vertex coloring.  Simple, but, full of learning, if wished.

Stay in touch and stay tuned for more/better comments.

This looks like what i'm talking about. Thanx! Need deep read , for my case

Link to comment
Share on other sites

hey

@3D for mortals

it is not ribbon it is a new Technic for make geometry in this way you make geometry builder function( like box , sphere , ... or any geometry you want ) 

and use it 

https://www.babylonjs-playground.com/#1ZEABJ#159

image.png.7ed7d5577d09bd8d1c0982c91479ddd6.png

for test use  http://editor.5kb.me/ (it is alpha version yet)

need some 3d edges struct for make it 

 

 

 

Link to comment
Share on other sites

3 hours ago, NasimiAsl said:

hey

@3D for mortals

it is not ribbon it is a new Technic for make geometry in this way you make geometry builder function( like box , sphere , ... or any geometry you want ) 

and use it 

https://www.babylonjs-playground.com/#1ZEABJ#159

image.png.7ed7d5577d09bd8d1c0982c91479ddd6.png

for test use  http://editor.5kb.me/ (it is alpha version yet)

need some 3d edges struct for make it 

 

 

 

I fast look the code and youtube examples, and looks like your way is:

- create flat contour , because paths have no z coordinates;

- create flat shape from this flat contour

- inside flat shape create new vertex and offset the vertex from zero z coordinate position to new z

this method will be good for creating a random surface of the earth, such as hills or pits, but i need something close ribbons, because i need more industrial, technical strictly surface.

Am i right, about your way? ... (hills and pits)

 ... and , after you complete the library functionality, think about more short way to create surfaces(short syntax if possible), because now the way look very long, and this little scared me(i think others can too), or i don't understand situation , and other libs have same length of creating way.

p.s. and i can't turn off "sign in" invite box on geometry builder screen. It take 25% of screen width.

Link to comment
Share on other sites

On 10/16/2016 at 3:48 PM, NasimiAsl said:

hi All

GeometryBuilder Alpha version is Ready 

This Is Core Version We can make GeometryBuilder Template like face , Box , Sphere or ...

geometryBuilder Has 2 part for any Template

1. the Builder

2. the Creator

 

in part 1 we define how  we make face with vertices and make uv and define what setting we need for make a instance of this Geometry template 

and in part 2 just fill the setting (this defined in part 1) and make a mesh

simple Face

part 1


  var face = function (op) {
            // define a template builder
            var builder = function (setting /*setting of template */ , geo /*automatic generated in GB (current instance)*/) {
                /*make a face in the geo instance*/
                GB.MakeFace(geo, [setting.p1, setting .p2, setting .p3, setting .p4]
					, { faceUVMap: "0123",  // uv map draw side
				        uvStart: { u: 0., v: 0. }, 
				        uvEnd: { u: 1., v: 1. }   }); 
					   
            };
             
            return new BABYLONX.Geometry(GB.GeometryBase(op, builder ));
   }

part 2 :


 var mesh = face({
                p1: { x: -1., y: 0.0, z: -1 },
                p2: { x: -1., y: 0., z: 1 },
                p3: { x: 1., y: 0., z: -1 },
                p4: { x: 1., y: 0.0, z: 1 }, 
		  }).toMesh(scene);  

http://www.babylonjs-playground.com/#1QC9DP#5

 

some template sample :

box : http://www.babylonjs-playground.com/#1QC9DP#4

Cylinder : http://www.babylonjs-playground.com/#1QC9DP#6

Cone : http://www.babylonjs-playground.com/#1QC9DP#7

something special :) : http://www.babylonjs-playground.com/#1QC9DP#8

smooth version : http://www.babylonjs-playground.com/#1QC9DP#9

*notice : this is preview version the final version in Test and refactor level 

cheers Nasimiasl

 

if you read this you can understand all part

Link to comment
Share on other sites

GeometryBuilder has SO MUCH mesh-plotting power, eh?  Unreal!   Love it.  Certainly worthy of learning-time.

Where is that "city buildings" demo?  Oh yeah... http://www.babylonjs-playground.com/index.html#FT2RY#78

Phew... too nice!  (mega-drool)  A bit off-topic, though.

(Wingnut opens NasimiAsl's brain... to see if he can learn how it works.)  I think there's a super-computer in his brain.  :)

Link to comment
Share on other sites

On 6/29/2018 at 6:17 PM, Wingnut said:

Hiya 3dfm!  Check this out...

https://www.babylonjs-playground.com/#1QD8LM#4

See the 'cubicBezier' in line 67?  That's something, eh?  :)

Ribbons... breakfast of parametric shape champions.   http://doc.babylonjs.com/how_to/parametric_shapes

I found this playground via a playground search for 'bezier' and 'ribbon'.   Hope this helps.

Oh yeah, the colors.  That scares me.  BJS HAS full color-per-vertex coloring, but you may need to "insert" those Color4-like color values.... into the mesh's vertexData colorKind/colors array - doing a little paint-by-numbers with a JS func.  :)  It's part of the fun! 

http://www.babylonjs-playground.com/#1UHFAP#60

(possibly outdated - perhaps there are newer ways of interacting with vertexData)

That playground... is a little intro-to plotting mesh, vertexData, and color-per-vertex coloring.  Simple, but, full of learning, if wished.

Stay in touch and stay tuned for more/better comments.

Another subquestion. Is ribbons need any additional manipulation , that correctly be exported to OBJ file?

Looks like i can display ribbons successful , but can't export to OBJ , but can export to OBJ other not ribbons meshes . : |

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...