nicklockwood / Euclid

A Swift library for creating and manipulating 3D geometry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a not closed curved line 3D line

nhevaweb opened this issue · comments

I'm trying to draw a curve like a curved tube
I'm generating a Path from my CGPath (containing curves), I tried using Mesh.extrude but it's creating a flat non curved ribbon.
Is Euclid able to render something like this ? Filled or not

image

You can create this with the loft primitive, but the API for it is a bit awkward at the moment as you have to provide an array of cross sections rather than one cross section and a path.

Hmm I generated a Path with a PathPoint array from a non closed BezierPath
Create a Mesh.loft with this Path and it renders a filled polygon with no depth.
Am I missing something here ?

@nhevaweb the paths you pass to the loft function are cross-sections (so in this case they would be circles). To create the tube you'd need to arrange multiple cross-sections in 3D space to form the tube.

@nhevaweb I've added a new extrude method that takes two paths on the develop branch. Please try it out and let me know if it works for you.