|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi
I know this question comes from time to time but mine is more a general one:
I am the maintainer of Eagle3D which contains a set of electronic
components which are all CSG.
To create a quick preview of the PCB I want to export these component
(maybe as obj-file) and render them with openGL.
Now I have the problem how to convert the models. My first idea was to
calculate the bounding box of every component and write them down to the
obj file. This will be the easiest way because I can do this in pure POV
SDL without any additional tool.
Second thougt was to create all the simple objects (box, sphere... )
outside any difference{} and intersection{} blocks and use them as basic
shape in my objs. This will need some external programm but souldn't be
to hard to implement but can produce bad results depending on how the
component was designed.
Third and maybe because it was late I build up a concept which is maybe
a bit crazy (it was really late when this came to my mind). Use POVRay
as some sort of "3D Scanner" to create a cloud of points in 3D which
then can later be triangulated and I have my mesh in a good quality
depending on the resolution of the 3D Scanner. Is it possible to shoot a
single ray into a scene from some given position and get back the
position of the first hit of the ray and also the color at this point?
Thanks for reading and I hope to get some feedback on all my ideas.
--
mat### [at] matweide
http://www.matwei.de
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> depending on the resolution of the 3D Scanner. Is it possible to shoot a
> single ray into a scene from some given position and get back the
> position of the first hit of the ray and also the color at this point?
OK. I have to answer myself. This is possible for the position and the
normal of an object. Is it also possible to get the color or do I have
to create a lot of images with 1x1 pixel in size?
--
mat### [at] matweide
http://www.matwei.de
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Second thougt was to create all the simple objects (box, sphere... )
> outside any difference{} and intersection{} blocks and use them as
> basic shape in my objs. This will need some external programm but
> souldn't be to hard to implement but can produce bad results depending on
> how
> the component was designed.
For this you would effectively have to write a parser for the POV SDL.
Unless you've written all the SDL with just numbers for all the coordinates
this would be quite some work. Compared to that, writing code to do CSG
operations on meshes would be easy. (It's not that hard anyway)
Maybe you could patch the POV source somehow to output the raw coordinates
of objects to your code, then it could create meshes etc.
Sounds like quite a job whatever you decide to do.
It might be quicker to redesign all the components as meshes from scratch.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <421e2f58$1@news.povray.org>,
> OK. I have to answer myself. This is possible for the position and the
> normal of an object. Is it also possible to get the color or do I have
> to create a lot of images with 1x1 pixel in size?
The color of an object depends on the direction the object is seen from
and on the rest of the scene, and the scene isn't fully constructed when
the file is still being parsed. So no, you can't get the color that way.
If you have the pigment, you can evaluate its color instead, which is
normally independent of viewing direction.
Another thing: generating a surface from a cloud of unconnected points
is extremely difficult. It is actually impossible to do so perfectly,
though simply using a large number of points can give good results in
many cases. You would really be better off designing meshes for each
component. This doesn't necessarily require a mesh editor, you could
write code in POV that generates the meshes you need, as long as there
aren't any difficult differences or intersections.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> OK. I have to answer myself. This is possible for the position and the
> normal of an object. Is it also possible to get the color or do I have
> to create a lot of images with 1x1 pixel in size?
Depends. If your color is based upon some pigment, then yes, you'd have to
do the 1x1 image thing. If by color you want to know which object you've
hit, you can also just use trace() on the different objects, and sort the
results with whatever sorting you need.
BTW <shameless plug> I've just recently written a set of Macros entitled
"Surcoat Macros", which might do that point-cloud-thingy quite well
</shameless plug>. :-)
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Have a look at "CSG to Mesh" in p.t.s-f
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |