Extruding shapes along Y axis.

Recommended Posts

Hi, I'm new to babylon JS, sorry for silly questions.
I follow this tutorial http://doc.babylonjs.com/tutorials/Parametric_Shapes and when i'm extruding my 2D shape along Z axis it looks just fine: http://www.babylonjs-playground.com/#RF9W9#387

When I do it along Y axis (with changed path) result becomes flat:
http://www.babylonjs-playground.com/#RF9W9#389

How do I create correct path?

Share on other sites

Hi @Treant and welcome.  It mig

ht not jump out at you but it is in the documentation that you can only extrude along the z axis

Quote

you only set these points in the xOy plane, so every z coordinate is zero. ..... Let's now imagine you could stretch this 2D shape along the Z-axis to give it some volume... this is extrusion

Well OK you can give a little variation to x and y as you extrude along Z but as set up currently you can only extrude in the general Z direction.

For any other direction you need to extrude along z axis and rotate the finished mesh.

It is possible to use a ribbon to produce an extrusion in any direction but you have to do a little more work.

If you want to play around with extrusions give this a go http://cubees.github.io/factory/extrude/extrude.html you can download the results as a .babylon file.

Share on other sites

i working on something else, maybe its helpful i leave it here

minimal version:

Share on other sites

I think there's is a little misunderstanding here.

When using extrusion, you have two steps :

- the shape definition what will be used as a model to be extruded along an axis in the space. This shape is to defined in the xOy plane (actually, you can set some z values if you want). Just consider that this plane is the one that will be slided along the axis, orthogonally to it.

- the path definition what is the curved axis (or linear) the model is extruded along. It can go to any direction in the space.

So

# 1 : planar model described in xOy plane whatever the extrusion path then

# 2 : extrusion path whatever the chosen planar model

There's no constraint nor dependancy between #1 and #2

Share on other sites

@jerome
must stop following my expections which were that #1 and #2 were not independent. Now all is clear.

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.