discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Bending a flat 3D object.

TP
Torsten Paul
Tue, May 8, 2018 9:40 PM

On 05/08/2018 11:31 PM, Parkinbot wrote:

Facing problems like this, we always end up in more or less
the same feature request.  >

Indeed. But always it's also completely ignored that there is
also an option to implement things in the OpenSCAD application.

ciao,
Torsten.

On 05/08/2018 11:31 PM, Parkinbot wrote: > Facing problems like this, we always end up in more or less > the same feature request. > Indeed. But always it's also completely ignored that there is also an option to implement things in the OpenSCAD application. ciao, Torsten.
P
Parkinbot
Wed, May 9, 2018 10:36 AM

What do you mean? Define the thing in OpenSCAD firsthand? Reinventing the
wheel is not always an option.

tp3 wrote

Indeed. But always it's also completely ignored that there is
also an option to implement things in the OpenSCAD application.

What do you mean? Define the thing in OpenSCAD firsthand? Reinventing the wheel is not always an option. tp3 wrote > Indeed. But always it's also completely ignored that there is > also an option to implement things in the OpenSCAD application. -- Sent from: http://forum.openscad.org/
TP
Torsten Paul
Wed, May 9, 2018 4:57 PM

On 05/09/2018 12:36 PM, Parkinbot wrote:

What do you mean? Define the thing in OpenSCAD firsthand > Reinventing the wheel is not always an option.

Hm? I'm not sure I understand the question and what wheel
we are talking about.

What I mean is, that for example Doug said it would work if
there was support for non-affine transformations. Right now
CGAL does not seem to support the full range of possible
transformation matrices but it still might be possible to
implement this in OpenSCAD for the generic multmatrix() module.

So while that not solves the "I want access to the vertex
data" it would still allow the original problem to be solved.

And there's probably a lot of similar topics too, like
re-meshing / subdivision, linear_extrude with offset...

ciao,
Torsten.

On 05/09/2018 12:36 PM, Parkinbot wrote: > What do you mean? Define the thing in OpenSCAD firsthand > Reinventing the wheel is not always an option. > Hm? I'm not sure I understand the question and what wheel we are talking about. What I mean is, that for example Doug said it would work if there was support for non-affine transformations. Right now CGAL does not seem to support the full range of possible transformation matrices but it still might be possible to implement this in OpenSCAD for the generic multmatrix() module. So while that not solves the "I want access to the vertex data" it would still allow the original problem to be solved. And there's probably a lot of similar topics too, like re-meshing / subdivision, linear_extrude with offset... ciao, Torsten.
G
Gadgetmind
Wed, May 9, 2018 5:33 PM

On 08/05/18 22:31, Parkinbot wrote:

mypolygon = import( "TA5[1-layer].dxf" );

and get a list of list of 2D-points in the case of a dxf.

I love OpenSCAD but it's a bit "black and white" in that either you can
do it easily with built ins or you have to use point/polygon/polyhedron
data, matrix/splines/etc transforms, and fire pretty much finished
geometry into the "backend". If doing the latter, there are better
packages around, and TBH adding all the required bending, smoothing and
filleting to OpenSCAD is a larger job than I can ever see happening.

I can foresee a time when I create all geometry in (probably) Python and
use OpenSCAD for binary ops (slicing for printing) which would be a shame.

No criticism of the devs, who've created something wonderful that I use
daily, but it's hard to see an easy way to get OpenSCAD to the "next level".

On 08/05/18 22:31, Parkinbot wrote: > mypolygon = import( "TA5[1-layer].dxf" ); > > and get a list of list of 2D-points in the case of a dxf. I love OpenSCAD but it's a bit "black and white" in that either you can do it easily with built ins or you have to use point/polygon/polyhedron data, matrix/splines/etc transforms, and fire pretty much finished geometry into the "backend". If doing the latter, there are better packages around, and TBH adding all the required bending, smoothing and filleting to OpenSCAD is a larger job than I can ever see happening. I can foresee a time when I create all geometry in (probably) Python and use OpenSCAD for binary ops (slicing for printing) which would be a shame. No criticism of the devs, who've created something wonderful that I use daily, but it's hard to see an easy way to get OpenSCAD to the "next level".
P
Parkinbot
Wed, May 9, 2018 6:29 PM

I don't see built-in non-affine transformations ever coming up in OpenSCAD -
just like there will be never a build-in sweep(). The implications for this
kind of operations are too large. Every second transformed object will throw
a CGAL exception, because people who don't know what they do will use it and
complain.
For me this is typical library stuff.
In contrast it would be so much easier to implement vertex access for
import, see what people will (and can) do with it, and then decide what of
this extra functionality can be brought into the App.

--
Sent from: http://forum.openscad.org/

I don't see built-in non-affine transformations ever coming up in OpenSCAD - just like there will be never a build-in sweep(). The implications for this kind of operations are too large. Every second transformed object will throw a CGAL exception, because people who don't know what they do will use it and complain. For me this is typical library stuff. In contrast it would be so much easier to implement vertex access for import, see what people will (and can) do with it, and then decide what of this extra functionality can be brought into the App. -- Sent from: http://forum.openscad.org/
DM
doug moen
Wed, May 9, 2018 7:19 PM

@Gadgetmind said: it's hard to see an easy way to get OpenSCAD to the "next
level".

The single "easy" thing we could do that would add the most value is to add
the ability to query a shape and get back information like the bounding
box, the triangle mesh. Then users could implement their own geometric
operators, without the dev team and knowledge of C++ being the bottle neck
for new geometric primitives.

Then there are also "hard" things we could do.

A few years ago, there was discussion on the mailing list about extending
OpenSCAD to support implicit functions and signed distance fields, which is
a different representation than triangle meshes, and which is much more
powerful for certain applications. For example, you can implement
operations like bending, smoothing and filleting in not very much code.
There was an OpenSCAD clone called ImplicitCAD from 2011 that people were
referencing, which uses implicit functions to represent geometry.

So I started to investigate this. Originally my idea was to extend OpenSCAD
with this new geometry representation. Eventually, I realized that creating
a hybrid geometry engine that supports both triangle meshes and implicit
functions was going to be too much work, so I scaled back to just focus on
signed distance fields.

So anyway, the technology works. I'm using Curv for my own 3D printing
projects now. I use the bending, smoothing and filleting a lot. It's not
backward compatible with OpenSCAD though, because again, I investigated
that, and it was going to be way too much work. One reason is that you end
up using a different programming style than OpenSCAD. You defined models
using an exact mathematical representation. You can apply transformations
like twist and bend, and the output is still an exact mathematical
representation, you don't need to worry about where do the triangles go
when you bend a cylinder. You just need to know math, like how to map from
cartesian to polar coordinates (for a bend). That's what makes this
representation easier to program with than triangle meshes. Triangles don't
appear until the last step, when you export the model as an STL file. At
that point, complicated algorithms written by experts must be used to fit
triangles to your shape. But this complicated code is quite localized:
knowledge about how to construct triangle meshes doesn't leak into every
new primitive that you add to the library.

So that's my personal answer to the question of how do you implement fancy
geometric operations like twist, bend, fillet and smooth.

So can this technology be added to OpenSCAD? It should be possible.
Somebody could design a hybrid geometry engine that supports both triangle
meshes and signed distance fields, and that converts between the two
representations as necessary. I know of one other modelling tool that does
this called IceSL, however it is not open source, so you can't look at the
code to see how they did it.

At this point, I use Curv to create models (I'm more focussed on things
like generative design and fractals, than on CAD). I use Curv to create the
initial mesh, then I use tools like MeshLab and OpenSCAD to process the
mesh for 3D printing. Curv has boolean operations, but it does not perform
exact boolean operations on meshes: that's where OpenSCAD really shines.

On 9 May 2018 at 13:33, Gadgetmind lists@foxhill.co.uk wrote:

On 08/05/18 22:31, Parkinbot wrote:

mypolygon = import( "TA5[1-layer].dxf" );

and get a list of list of 2D-points in the case of a dxf.

I love OpenSCAD but it's a bit "black and white" in that either you can do
it easily with built ins or you have to use point/polygon/polyhedron data,
matrix/splines/etc transforms, and fire pretty much finished geometry into
the "backend". If doing the latter, there are better packages around, and
TBH adding all the required bending, smoothing and filleting to OpenSCAD is
a larger job than I can ever see happening.

I can foresee a time when I create all geometry in (probably) Python and
use OpenSCAD for binary ops (slicing for printing) which would be a shame.

No criticism of the devs, who've created something wonderful that I use
daily, but it's hard to see an easy way to get OpenSCAD to the "next level".


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

@Gadgetmind said: it's hard to see an easy way to get OpenSCAD to the "next level". The single "easy" thing we could do that would add the most value is to add the ability to query a shape and get back information like the bounding box, the triangle mesh. Then users could implement their own geometric operators, without the dev team and knowledge of C++ being the bottle neck for new geometric primitives. Then there are also "hard" things we could do. A few years ago, there was discussion on the mailing list about extending OpenSCAD to support implicit functions and signed distance fields, which is a different representation than triangle meshes, and which is much more powerful for certain applications. For example, you can implement operations like bending, smoothing and filleting in not very much code. There was an OpenSCAD clone called ImplicitCAD from 2011 that people were referencing, which uses implicit functions to represent geometry. So I started to investigate this. Originally my idea was to extend OpenSCAD with this new geometry representation. Eventually, I realized that creating a hybrid geometry engine that supports both triangle meshes and implicit functions was going to be too much work, so I scaled back to just focus on signed distance fields. So anyway, the technology works. I'm using Curv for my own 3D printing projects now. I use the bending, smoothing and filleting a lot. It's not backward compatible with OpenSCAD though, because again, I investigated that, and it was going to be way too much work. One reason is that you end up using a different programming style than OpenSCAD. You defined models using an exact mathematical representation. You can apply transformations like twist and bend, and the output is still an exact mathematical representation, you don't need to worry about where do the triangles go when you bend a cylinder. You just need to know math, like how to map from cartesian to polar coordinates (for a bend). That's what makes this representation easier to program with than triangle meshes. Triangles don't appear until the last step, when you export the model as an STL file. At that point, complicated algorithms written by experts must be used to fit triangles to your shape. But this complicated code is quite localized: knowledge about how to construct triangle meshes doesn't leak into every new primitive that you add to the library. So that's my personal answer to the question of how do you implement fancy geometric operations like twist, bend, fillet and smooth. So can this technology be added to OpenSCAD? It should be possible. Somebody could design a hybrid geometry engine that supports both triangle meshes and signed distance fields, and that converts between the two representations as necessary. I know of one other modelling tool that does this called IceSL, however it is not open source, so you can't look at the code to see how they did it. At this point, I use Curv to create models (I'm more focussed on things like generative design and fractals, than on CAD). I use Curv to create the initial mesh, then I use tools like MeshLab and OpenSCAD to process the mesh for 3D printing. Curv has boolean operations, but it does not perform exact boolean operations on meshes: that's where OpenSCAD really shines. On 9 May 2018 at 13:33, Gadgetmind <lists@foxhill.co.uk> wrote: > On 08/05/18 22:31, Parkinbot wrote: > > mypolygon = import( "TA5[1-layer].dxf" ); > > and get a list of list of 2D-points in the case of a dxf. > > I love OpenSCAD but it's a bit "black and white" in that either you can do > it easily with built ins or you have to use point/polygon/polyhedron data, > matrix/splines/etc transforms, and fire pretty much finished geometry into > the "backend". If doing the latter, there are better packages around, and > TBH adding all the required bending, smoothing and filleting to OpenSCAD is > a larger job than I can ever see happening. > > I can foresee a time when I create all geometry in (probably) Python and > use OpenSCAD for binary ops (slicing for printing) which would be a shame. > > No criticism of the devs, who've created something wonderful that I use > daily, but it's hard to see an easy way to get OpenSCAD to the "next level". > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
TP
Torsten Paul
Wed, May 9, 2018 7:22 PM

On 05/09/2018 07:33 PM, Gadgetmind wrote:

No criticism of the devs, who've created something wonderful
that I use daily, but it's hard to see an easy way to get > OpenSCAD to the "next level".

I can see lots of opportunities, like there is an still
incomplete pull request for linear_extrude() with offset.
Now let's just image we can give that offset parameter a
function as value. I believe that could open quite some
possibilities even if it's not quite a general extrusion
along an arbitrary 3d path.

ciao,
Torsten.

On 05/09/2018 07:33 PM, Gadgetmind wrote: > No criticism of the devs, who've created something wonderful > that I use daily, but it's hard to see an easy way to get > OpenSCAD to the "next level". > I can see lots of opportunities, like there is an still incomplete pull request for linear_extrude() with offset. Now let's just image we can give that offset parameter a function as value. I believe that could open quite some possibilities even if it's not quite a general extrusion along an arbitrary 3d path. ciao, Torsten.
PF
Peter Falke
Wed, May 9, 2018 9:37 PM

Just print it flat, heat it in an oven, and bend it as desired.
Makes for a much stronger part, too.

2018-05-09 21:22 GMT+02:00 Torsten Paul Torsten.Paul@gmx.de:

On 05/09/2018 07:33 PM, Gadgetmind wrote:

No criticism of the devs, who've created something wonderful
that I use daily, but it's hard to see an easy way to get > OpenSCAD to
the "next level".

I can see lots of opportunities, like there is an still

incomplete pull request for linear_extrude() with offset.
Now let's just image we can give that offset parameter a
function as value. I believe that could open quite some
possibilities even if it's not quite a general extrusion
along an arbitrary 3d path.

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Just print it flat, heat it in an oven, and bend it as desired. Makes for a much stronger part, too. 2018-05-09 21:22 GMT+02:00 Torsten Paul <Torsten.Paul@gmx.de>: > On 05/09/2018 07:33 PM, Gadgetmind wrote: > >> No criticism of the devs, who've created something wonderful >> that I use daily, but it's hard to see an easy way to get > OpenSCAD to >> the "next level". >> >> I can see lots of opportunities, like there is an still > incomplete pull request for linear_extrude() with offset. > Now let's just image we can give that offset parameter a > function as value. I believe that could open quite some > possibilities even if it's not quite a general extrusion > along an arbitrary 3d path. > > ciao, > Torsten. > > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
W
WillAdams
Tue, Apr 21, 2020 8:40 PM

I worked up a very simple hack for this --- basically cut the object up using
intersections and add a cylinder at the bend point to simulate the material
stretch:

https://community.carbide3d.com/t/design-into-3d-boxes-coopered-boxes/20154/45

(in a future iteration I'll add an offset intersection to test for
interference)

William

--
Sent from: http://forum.openscad.org/

I worked up a very simple hack for this --- basically cut the object up using intersections and add a cylinder at the bend point to simulate the material stretch: https://community.carbide3d.com/t/design-into-3d-boxes-coopered-boxes/20154/45 (in a future iteration I'll add an offset intersection to test for interference) William -- Sent from: http://forum.openscad.org/
T
TLC123
Wed, Apr 22, 2020 11:22 AM

from feature

mypolygon = import( "TA5[1-layer].dxf" );
mypolyhedron= import( "TA5[1-model].stl" );

logic features follows:

mypolygon = importResultOf( "stuff.scad" );
mypolyhedron= importResultOf( "stuff.scad" );

mypolygon = importResultOf( "stuff.scad::thatModule()" );
mypolyhedron= importResultOf( "stuff.scad::thatModule()"" );

mypolygon = importResultOf( "thisFileItSelf.scad::thatModule()" );
mypolyhedron= importResultOf( "thisFileItSelf::thatModule()"" );

--
Sent from: http://forum.openscad.org/

from feature mypolygon = import( "TA5[1-layer].dxf" ); mypolyhedron= import( "TA5[1-model].stl" ); logic features follows: mypolygon = importResultOf( "stuff.scad" ); mypolyhedron= importResultOf( "stuff.scad" ); mypolygon = importResultOf( "stuff.scad::thatModule()" ); mypolyhedron= importResultOf( "stuff.scad::thatModule()"" ); mypolygon = importResultOf( "thisFileItSelf.scad::thatModule()" ); mypolyhedron= importResultOf( "thisFileItSelf::thatModule()"" ); -- Sent from: http://forum.openscad.org/