Putting things on other things

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Putting things on other things

Joseph Lenox
Been beating my head against a wall here. I want the ability to locate
an object "on top" of an arbitrary polyhedron.

While I know that (at present) you can't return geometry from an object,
I can look at the points in a polyhedron() and calculate the plane on
which one of the faces is. I also figure you could pre-process an STL
file to get the same values for some arbitrary face. Has anyone put
together a function or similar to make these calculations to pass the
correct values to effectively move (0,0,0) to the center of a plane of
three (non-collinear points) and rotate the axis to be along the normal
of the plane?

If not, I guess it's time to crack open the geometry book and get to work :(

--
--Joseph Lenox, BS, MS
I'm an engineer. I solve problems.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Putting things on other things

Johannes Reinhardt
You can take a look at loca.scad:

 https://github.com/jreinhardt/local-scad

You can create a new coordinate system from your support point and two directions. If you have 3 points in a plane, you can use one as a support point and the difference to the other two as directions. local-scad does the orthonormalisation.


Am Dienstag, 30. September 2014 07:28 UTC, Joseph Lenox <[hidden email]> schrieb:
 

> Been beating my head against a wall here. I want the ability to locate
> an object "on top" of an arbitrary polyhedron.
>
> While I know that (at present) you can't return geometry from an object,
> I can look at the points in a polyhedron() and calculate the plane on
> which one of the faces is. I also figure you could pre-process an STL
> file to get the same values for some arbitrary face. Has anyone put
> together a function or similar to make these calculations to pass the
> correct values to effectively move (0,0,0) to the center of a plane of
> three (non-collinear points) and rotate the axis to be along the normal
> of the plane?
>
> If not, I guess it's time to crack open the geometry book and get to work :(
>
> --
> --Joseph Lenox, BS, MS
> I'm an engineer. I solve problems.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
 
 
 
 

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Putting things on other things

kintel
Administrator

On Sep 30, 2014, at 04:13 AM, Johannes Reinhardt <[hidden email]> wrote:

> https://github.com/jreinhardt/local-scad
>
* Added to https://github.com/openscad/openscad/wiki/Libraries

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566