Color a 3D triangle

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

Color a 3D triangle

Maurice van Peursem
I've defined a triangle in 3D space with 3 points, and I want to
color it. Is there an easy way to do that, or must I find the plane
that the points are in and then convert the coordinates to 2D so I
can define a polygon?

Maurice


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Color a 3D triangle

MichaelAtOz
Administrator
You can't have a 3D triangle with three points.
Three points is a 2D triangle, you have just placed it in 3D, which is not
supported.
Either way see  color() in the wiki
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color>
.



-----
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!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: Color a 3D triangle

Parkinbot
In reply to this post by Maurice van Peursem
You can do that by (ab)using polyhedron. Don't expect the result to be
printable.


x=[[1,2,3], [-10,3,-1], [0,0,0]];
color("red")
polyhedron(x, [[0,1,2]]);



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Color a 3D triangle

Maurice van Peursem
That seems to work fine and is just what I need, thanks!

Maurice


>You can do that by (ab)using polyhedron. Don't expect the result to be
>printable.
>
>x=[[1,2,3], [-10,3,-1], [0,0,0]];
>color("red")
>polyhedron(x, [[0,1,2]]);

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org