discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Hose Adapter for table saw

RW
Rogier Wolff
Fri, Aug 18, 2023 8:28 AM

On Thu, Aug 17, 2023 at 11:56:36PM +0000, Jordan Brown wrote:

But alas STL does not represent color,

STL is just one output format that happens to not-support color.
There are other formats that do.

and OpenSCAD cannot currently render with color,

That is the essential issue, I think.

I don't know enough about
CGAL to know for sure, but my bet is that there's no way to get it to
carry such a tag through its processing.

I would think that a "preview-render" would be enough to find
real-world coordinates for things.

Suppose we tell OpenGL offscreen 1024x1024 framebuffer orthogonal
projection from TOP, then we render everything, and the "pin" we
render just like the pink see-through objects-tagged-with-# : On top
of everything. Now we can look at the framebuffer, and find the one
pixel that has become pink. Oh.... we can tell openGL to not-render
all normal objects (100% transparent). If you use say a 1024x1024
buffer, you can "zoom in" by a factor of 512 to render an originally
2x2 pixel area again in a 1024x1024 frame buffer and get 9 more bits
of accuracy. The new framebuffer should be centered on the center of
the pixel that was orginally pink. It might be possible to zoom by up
to 1024, but zooming by "only" 512 is for certain going to be useful
to get the "center on the center of the pixel" correct while debugging
the code.

Do this for one or two(*) more axes and you've got all three coordinates,
using the preview-engine.

There might be tools (API) inside of openGL to not have to search the
whole 1Mpixel framebuffer. People want to add 2D tags to objects in
the rendered 3D space. Think of the place names or pins in a 3D render
in google earth.

This might be the hint:
https://stackoverflow.com/questions/3792481/how-to-get-screen-coordinates-from-a-3d-point-opengl

Roger. 

(*) If you do two more views, you'll get all coordinates twice. Might
be good for verification or a little extra accuracy.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Thu, Aug 17, 2023 at 11:56:36PM +0000, Jordan Brown wrote: > But alas STL does not represent color, STL is just one output format that happens to not-support color. There are other formats that do. > and OpenSCAD cannot currently render with color, That is the essential issue, I think. > I don't know enough about > CGAL to know for sure, but my bet is that there's no way to get it to > carry such a tag through its processing. I would think that a "preview-render" would be enough to find real-world coordinates for things. Suppose we tell OpenGL offscreen 1024x1024 framebuffer orthogonal projection from TOP, then we render everything, and the "pin" we render just like the pink see-through objects-tagged-with-# : On top of everything. Now we can look at the framebuffer, and find the one pixel that has become pink. Oh.... we can tell openGL to not-render all normal objects (100% transparent). If you use say a 1024x1024 buffer, you can "zoom in" by a factor of 512 to render an originally 2x2 pixel area again in a 1024x1024 frame buffer and get 9 more bits of accuracy. The new framebuffer should be centered on the center of the pixel that was orginally pink. It might be possible to zoom by up to 1024, but zooming by "only" 512 is for certain going to be useful to get the "center on the center of the pixel" correct while debugging the code. Do this for one or two(*) more axes and you've got all three coordinates, using the preview-engine. There might be tools (API) inside of openGL to not have to search the whole 1Mpixel framebuffer. People want to add 2D tags to objects in the rendered 3D space. Think of the place names or pins in a 3D render in google earth. This might be the hint: https://stackoverflow.com/questions/3792481/how-to-get-screen-coordinates-from-a-3d-point-opengl Roger. (*) If you do two more views, you'll get all coordinates twice. Might be good for verification or a little extra accuracy. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
ER
edmund ronald
Fri, Aug 18, 2023 2:06 PM

Yes, I was wondering if one couldn't hack the existing GUI to do something
based on color. As one can display different objects in different colors in
the UI

On Fri, Aug 18, 2023 at 10:28 AM Rogier Wolff R.E.Wolff@bitwizard.nl
wrote:

On Thu, Aug 17, 2023 at 11:56:36PM +0000, Jordan Brown wrote:

But alas STL does not represent color,

STL is just one output format that happens to not-support color.
There are other formats that do.

and OpenSCAD cannot currently render with color,

That is the essential issue, I think.

I don't know enough about
CGAL to know for sure, but my bet is that there's no way to get it to
carry such a tag through its processing.

I would think that a "preview-render" would be enough to find
real-world coordinates for things.

Suppose we tell OpenGL offscreen 1024x1024 framebuffer orthogonal
projection from TOP, then we render everything, and the "pin" we
render just like the pink see-through objects-tagged-with-# : On top
of everything. Now we can look at the framebuffer, and find the one
pixel that has become pink. Oh.... we can tell openGL to not-render
all normal objects (100% transparent). If you use say a 1024x1024
buffer, you can "zoom in" by a factor of 512 to render an originally
2x2 pixel area again in a 1024x1024 frame buffer and get 9 more bits
of accuracy. The new framebuffer should be centered on the center of
the pixel that was orginally pink. It might be possible to zoom by up
to 1024, but zooming by "only" 512 is for certain going to be useful
to get the "center on the center of the pixel" correct while debugging
the code.

Do this for one or two(*) more axes and you've got all three coordinates,
using the preview-engine.

There might be tools (API) inside of openGL to not have to search the
whole 1Mpixel framebuffer. People want to add 2D tags to objects in
the rendered 3D space. Think of the place names or pins in a 3D render
in google earth.

This might be the hint:
https://stackoverflow.com/questions/3792481/how-to-get-
screen-coordinates-from-a-3d-point-opengl

     Roger.

(*) If you do two more views, you'll get all coordinates twice. Might
be good for verification or a little extra accuracy.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

Yes, I was wondering if one couldn't hack the existing GUI to do something based on color. As one can display different objects in different colors in the UI On Fri, Aug 18, 2023 at 10:28 AM Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Thu, Aug 17, 2023 at 11:56:36PM +0000, Jordan Brown wrote: > > But alas STL does not represent color, > > STL is just one output format that happens to not-support color. > There are other formats that do. > > > and OpenSCAD cannot currently render with color, > > That is the essential issue, I think. > > > I don't know enough about > > CGAL to know for sure, but my bet is that there's no way to get it to > > carry such a tag through its processing. > > I would think that a "preview-render" would be enough to find > real-world coordinates for things. > > Suppose we tell OpenGL offscreen 1024x1024 framebuffer orthogonal > projection from TOP, then we render everything, and the "pin" we > render just like the pink see-through objects-tagged-with-# : On top > of everything. Now we can look at the framebuffer, and find the one > pixel that has become pink. Oh.... we can tell openGL to not-render > all normal objects (100% transparent). If you use say a 1024x1024 > buffer, you can "zoom in" by a factor of 512 to render an originally > 2x2 pixel area again in a 1024x1024 frame buffer and get 9 more bits > of accuracy. The new framebuffer should be centered on the center of > the pixel that was orginally pink. It might be possible to zoom by up > to 1024, but zooming by "only" 512 is for certain going to be useful > to get the "center on the center of the pixel" correct while debugging > the code. > > Do this for one or two(*) more axes and you've got all three coordinates, > using the preview-engine. > > There might be tools (API) inside of openGL to not have to search the > whole 1Mpixel framebuffer. People want to add 2D tags to objects in > the rendered 3D space. Think of the place names or pins in a 3D render > in google earth. > > This might be the hint: > https://stackoverflow.com/questions/3792481/how-to-get- > screen-coordinates-from-a-3d-point-opengl > > Roger. > > > (*) If you do two more views, you'll get all coordinates twice. Might > be good for verification or a little extra accuracy. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. >
JB
Jordan Brown
Fri, Aug 18, 2023 4:57 PM

[ Let's try to fix the subject...]

On 8/18/2023 1:28 AM, Rogier Wolff wrote:

I would think that a "preview-render" would be enough to find
real-world coordinates for things.

Maybe.  Such a scheme would be outside my knowledge, without a big
learning curve.

But if one was satisfied with a pin with its coordinates reported in the
console, and was willing to live with the various restrictions, it seems
like the "carry the transforms down through the execution context"
scheme would be straightforward enough.  It's just hard to see how to
turn it into anything like a decent measurement user interface.

One could imagine making the parent transformation matrix available via
a function or $ variable.  Reset it to identity inside an extrusion,
minkowski second arg, et cetera.  But again, the "black hole" nature of
modules, that there's no way to get information out of one, would make
the value very limited.

[ Let's try to fix the subject...] On 8/18/2023 1:28 AM, Rogier Wolff wrote: > I would think that a "preview-render" would be enough to find > real-world coordinates for things. Maybe.  Such a scheme would be outside my knowledge, without a big learning curve. But if one was satisfied with a pin with its coordinates reported in the console, and was willing to live with the various restrictions, it seems like the "carry the transforms down through the execution context" scheme would be straightforward enough.  It's just hard to see how to turn it into anything like a decent measurement user interface. One could imagine making the parent transformation matrix available via a function or $ variable.  Reset it to identity inside an extrusion, minkowski second arg, et cetera.  But again, the "black hole" nature of modules, that there's no way to get information out of one, would make the value very limited.
AM
Adrian Mariano
Sun, Aug 20, 2023 8:21 PM

To use join_prism() from BOSL2 you would need to join the side section onto
a cylindrical portion and move the taper somewhere else.  That is,
join_prism() cannot have the base be a cone, only a true prism of some kind
(or a plane or sphere).

On Wed, Aug 16, 2023 at 4:52 PM Revar Desmera revarbat@gmail.com wrote:

The main difficult part of this is the fillet between the tubes.  That
should be doable with join_prism() (see example 12) in rounding.scad.
The curve of the smaller tube can be done either with turtle3d, or with
path_sweep() in skin.scad. The threading, of course, is available in
threading.scad.

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism

https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#functionmodule-path_sweep

https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-threaded_rod

I am unsure if join_prism() can use a cone as a base, though.  Adrian,
is there a way to do that?

  • Revar

On Aug 16, 2023, at 12:11 AM, Karl Exler karl.exler@meinklang.cc wrote:

Dear all
I found the enclosed adapter on Thingiverse. Unfortunately nearly all
diameters are not in that size I need it. Did anyone of you created such an
(similar) object in Openscad? Is it possible to get that file?
Or- if not- how would an expert start with that projects?

Until now I only use Openscad functions and some of the BOSL libraries.

Many thanks in advance
Karl
<dewalt.png>_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

To use join_prism() from BOSL2 you would need to join the side section onto a cylindrical portion and move the taper somewhere else. That is, join_prism() cannot have the base be a cone, only a true prism of some kind (or a plane or sphere). On Wed, Aug 16, 2023 at 4:52 PM Revar Desmera <revarbat@gmail.com> wrote: > The main difficult part of this is the fillet between the tubes. That > should be doable with `join_prism()` (see example 12) in rounding.scad. > The curve of the smaller tube can be done either with turtle3d, or with > `path_sweep()` in skin.scad. The threading, of course, is available in > threading.scad. > > - > https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#functionmodule-join_prism > - > https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#functionmodule-path_sweep > - > https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-threaded_rod > > I am unsure if `join_prism()` can use a cone as a base, though. Adrian, > is there a way to do that? > > - Revar > > > > On Aug 16, 2023, at 12:11 AM, Karl Exler <karl.exler@meinklang.cc> wrote: > > Dear all > I found the enclosed adapter on Thingiverse. Unfortunately nearly all > diameters are not in that size I need it. Did anyone of you created such an > (similar) object in Openscad? Is it possible to get that file? > Or- if not- how would an expert start with that projects? > > Until now I only use Openscad functions and some of the BOSL libraries. > > Many thanks in advance > Karl > <dewalt.png>_______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >