P
Parkinbot
Mon, Nov 16, 2015 5:42 PM
My feature request:
A function /obj2vec()/ to get a vector representation of an object.
Desirable for 2D objects (at least), 3D objects, included objects.
Don't know whether this feature offends the programming paradigm of OpenCAD,
but it would so useful to somehow get in touch with the mesh points of an
object. I'm aware that only rendering will produce a mesh, but isn't
/render()/ meant for this?
My bug report:
My OpenSCAD (ver. 2015.03-1) most of the time freezes after a standby
recovery (Windows 8.1, Windows 7). So it happens quite often, that I send my
machine to sleep without having saved my current designs and everything is
lost on wake up. I'm not sure, maybe this happens only or more often after a
rendering has been done. With multiple sessions not necessarily all of them
freeze.
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
My feature request:
A function /obj2vec()/ to get a vector representation of an object.
Desirable for 2D objects (at least), 3D objects, included objects.
Don't know whether this feature offends the programming paradigm of OpenCAD,
but it would so useful to somehow get in touch with the mesh points of an
object. I'm aware that only rendering will produce a mesh, but isn't
/render()/ meant for this?
My bug report:
My OpenSCAD (ver. 2015.03-1) most of the time freezes after a standby
recovery (Windows 8.1, Windows 7). So it happens quite often, that I send my
machine to sleep without having saved my current designs and everything is
lost on wake up. I'm not sure, maybe this happens only or more often after a
rendering has been done. With multiple sessions not necessarily all of them
freeze.
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
C
ctchin
Mon, Nov 16, 2015 6:44 PM
to get a vector representation of an object. Desirable for 2D objects (at
least), 3D objects, included objects.
Don't know whether this feature offends the programming paradigm of
OpenCAD
It does, deeply. Right now there are many ways to create a solid
from some quantities (e.g. cube([10,20,5]);) or to get values from
values (functions and operators) and even get a solid from a combination
of solids and values (transformation).
But there's no way to obtain any value with a solid as input.
And it's a good question if that should be changed.
Personally I am not too keen to get in touch with the mesh points within
OpenSCAD. If I need to, I could just export the STL to another program
that's good at playing with mesh points.
But I can think of lots of nice-to-have calculation from a solid:
min_x, max_x, width
min_y, max_y, depth
min_z, max_z, height
surface_area
volumn
etc
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14555.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Parkinbot wrote
> A function
/
> obj2vec()
/
> to get a vector representation of an object. Desirable for 2D objects (at
> least), 3D objects, included objects.
>
> Don't know whether this feature offends the programming paradigm of
> OpenCAD
It does, deeply. Right now there are many ways to create a solid
from some quantities (e.g. cube([10,20,5]);) or to get values from
values (functions and operators) and even get a solid from a combination
of solids and values (transformation).
But there's no way to obtain any value with a solid as input.
And it's a good question if that should be changed.
Personally I am not too keen to get in touch with the mesh points within
OpenSCAD. If I need to, I could just export the STL to another program
that's good at playing with mesh points.
But I can think of lots of nice-to-have calculation from a solid:
min_x, max_x, width
min_y, max_y, depth
min_z, max_z, height
surface_area
volumn
etc
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14555.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
DM
doug moen
Mon, Nov 16, 2015 7:39 PM
I've talked to Marius about this in the past. His concern is that this
could have a negative impact on the useability of OpenSCAD, by making F5
preview just as slow as F6 render. The problem is that operations to query
the mesh require us to render the shape into a mesh, and this would have to
be done even in preview mode.
So Marius's answer at the time was, let's replace our CGAL based renderer
with something much faster before we consider this change.
On 16 November 2015 at 13:44, ctchin c.t.chin@szu.edu.cn wrote:
to get a vector representation of an object. Desirable for 2D objects
least), 3D objects, included objects.
Don't know whether this feature offends the programming paradigm of
OpenCAD
It does, deeply. Right now there are many ways to create a solid
from some quantities (e.g. cube([10,20,5]);) or to get values from
values (functions and operators) and even get a solid from a combination
of solids and values (transformation).
But there's no way to obtain any value with a solid as input.
And it's a good question if that should be changed.
Personally I am not too keen to get in touch with the mesh points within
OpenSCAD. If I need to, I could just export the STL to another program
that's good at playing with mesh points.
But I can think of lots of nice-to-have calculation from a solid:
min_x, max_x, width
min_y, max_y, depth
min_z, max_z, height
surface_area
volumn
etc
--
View this message in context:
http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14555.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I've talked to Marius about this in the past. His concern is that this
could have a negative impact on the useability of OpenSCAD, by making F5
preview just as slow as F6 render. The problem is that operations to query
the mesh require us to render the shape into a mesh, and this would have to
be done even in preview mode.
So Marius's answer at the time was, let's replace our CGAL based renderer
with something much faster before we consider this change.
On 16 November 2015 at 13:44, ctchin <c.t.chin@szu.edu.cn> wrote:
> Parkinbot wrote
> > A function
> /
> > obj2vec()
> /
> > to get a vector representation of an object. Desirable for 2D objects
> (at
> > least), 3D objects, included objects.
> >
> > Don't know whether this feature offends the programming paradigm of
> > OpenCAD
>
> It does, deeply. Right now there are many ways to create a solid
> from some quantities (e.g. cube([10,20,5]);) or to get values from
> values (functions and operators) and even get a solid from a combination
> of solids and values (transformation).
>
> But there's no way to obtain any value with a solid as input.
>
> And it's a good question if that should be changed.
>
> Personally I am not too keen to get in touch with the mesh points within
> OpenSCAD. If I need to, I could just export the STL to another program
> that's good at playing with mesh points.
>
> But I can think of lots of nice-to-have calculation from a solid:
> min_x, max_x, width
> min_y, max_y, depth
> min_z, max_z, height
> surface_area
> volumn
> etc
>
>
>
> --
> View this message in context:
> http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14555.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
>
P
Parkinbot
Mon, Nov 16, 2015 8:04 PM
For sure this theme has been discussed many times before. And I'm fully aware
of the rendering problem. But, as I already suggested, an explicit or (why
not implicit) render() would be the penalty, and as the mesh would be cached
anyway for any following call I guess, one could easily life with it. With
included STLs getting the mesh points wouldn't be much overhead. This might
be a way to safely start implementing this feature.
doug.moen wrote
The problem is that operations to query
the mesh require us to render the shape into a mesh, and this would have
to
be done even in preview mode.
For sure this theme has been discussed many times before. And I'm fully aware
of the rendering problem. But, as I already suggested, an explicit or (why
not implicit) render() would be the penalty, and as the mesh would be cached
anyway for any following call I guess, one could easily life with it. With
included STLs getting the mesh points wouldn't be much overhead. This might
be a way to safely start implementing this feature.
doug.moen wrote
> The problem is that operations to query
> the mesh require us to render the shape into a mesh, and this would have
> to
> be done even in preview mode.
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14569.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
T
Trygon
Mon, Nov 16, 2015 8:18 PM
I agree with Parkinbot that access to the vertex and face data from included
stl files would be useful and should not present any performance issues:
object1=import("object1.stl");
polyhedron(points=object1[0], faces=object1[1]);
?
-Trygon
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14570.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I agree with Parkinbot that access to the vertex and face data from included
stl files would be useful and should not present any performance issues:
object1=import("object1.stl");
polyhedron(points=object1[0], faces=object1[1]);
?
-Trygon
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14570.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
C
clothbot
Mon, Nov 16, 2015 8:33 PM
Good idea, but don't overload import() (the module/object call) as a
function. Make the function something explicitly different like 'read()'.
Andrew.
Trygon wrote
I agree with Parkinbot that access to the vertex and face data from
included stl files would be useful and should not present any performance
issues:
object1=import("object1.stl");
polyhedron(points=object1[0], faces=object1[1]);
?
-Trygon
Good idea, but don't overload import() (the module/object call) as a
function. Make the function something explicitly different like 'read()'.
Andrew.
Trygon wrote
> I agree with Parkinbot that access to the vertex and face data from
> included stl files would be useful and should not present any performance
> issues:
>
> object1=import("object1.stl");
> polyhedron(points=object1[0], faces=object1[1]);
>
> ?
>
> -Trygon
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14572.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
R
runsun
Mon, Nov 16, 2015 9:03 PM
I've talked to Marius about this in the past. His concern is that this
could have a negative impact on the useability of OpenSCAD, by making F5
preview just as slow as F6 render. The problem is that operations to query
the mesh require us to render the shape into a mesh, and this would have
to
be done even in preview mode.
So Marius's answer at the time was, let's replace our CGAL based renderer
with something much faster before we consider this change.
I can attest to the slower F5 'cos I use polyhedron extensively in my lib.
On the other hand, this might still be done by providing it as an option,
using
it or not is entirely user's choice. IMO, that would provide a positive
impact
but not negative.
$ Runsun Pan, PhD
$ libs: doctest , faces ( git ), offline doc ( git ),runscad.py( 1 , 2 , git );
$ tips: hash( 1 , 2 ), sweep , var , lerp , animGif
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14577.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
doug.moen wrote
> I've talked to Marius about this in the past. His concern is that this
> could have a negative impact on the useability of OpenSCAD, by making F5
> preview just as slow as F6 render. The problem is that operations to query
> the mesh require us to render the shape into a mesh, and this would have
> to
> be done even in preview mode.
>
> So Marius's answer at the time was, let's replace our CGAL based renderer
> with something much faster before we consider this change.
I can attest to the slower F5 'cos I use polyhedron extensively in my lib.
On the other hand, this might still be done by providing it as an option,
using
it or not is entirely user's choice. IMO, that would provide a positive
impact
but not negative.
-----
$ Runsun Pan, PhD
$ libs: doctest , faces ( git ), offline doc ( git ),runscad.py( 1 , 2 , git );
$ tips: hash( 1 , 2 ), sweep , var , lerp , animGif
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14577.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Mon, Nov 16, 2015 9:44 PM
an explicit or (why not implicit) render() would be the penalty, and as the
mesh would be cached anyway for any following call I guess, one could easily
life with it.
That cache is only good iif all of the variables used are static; if you are
debugging and changing sizes/tolerances etc, the cache is useless. Hence F5
performance will be BAD.
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14580.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
> an explicit or (why not implicit) render() would be the penalty, and as the
mesh would be cached anyway for any following call I guess, one could easily
life with it.
That cache is only good iif all of the variables used are static; if you are
debugging and changing sizes/tolerances etc, the cache is useless. Hence F5
performance will be BAD.
-----
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14580.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Mon, Nov 16, 2015 11:58 PM
IMHO this could easily be mitigated by use of the Render() call.
I.e. if no render call then no context setup for querying.
This way there is no F5 penalty for queries to the mesh if user doesn't
render (),
AND calling render explicitly creates a mesh to be examined.
(Possibly suggetsing an assignment like mesh = render() creates a variable
to be examined)
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14587.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
IMHO this could easily be mitigated by use of the Render() call.
I.e. if no render call then no context setup for querying.
This way there is no F5 penalty for queries to the mesh if user doesn't
render (),
AND calling render explicitly creates a mesh to be examined.
(Possibly suggetsing an assignment like mesh = render() creates a variable
to be examined)
--
View this message in context: http://forum.openscad.org/feature-request-obj2vec-bug-report-freeze-on-standby-recovery-Windows-tp14549p14587.html
Sent from the OpenSCAD mailing list archive at Nabble.com.