POV-Ray : Newsgroups : povray.newusers : rendering edges : Re: rendering edges Server Time
6 Oct 2024 02:10:24 EDT (-0400)
  Re: rendering edges  
From: Chris B
Date: 11 Aug 2009 20:09:24
Message: <4a820834$1@news.povray.org>
"Mr" <nomail@nomail> wrote in message 
news:web.4a81df0e4068d214e3f0b2880@news.povray.org...
> ...
> Actually, there should'nt be any triangles since they are just extruded 
> vertices
> forming a long uninterrupted continuous series of edges like a spline 
> without
> interpolation. (hair)
> so they should'nt be arrays of 3 edges... only pairs one after the other. 
> I
> feel it should be easier to convert those to actual geometry on blender 
> side.
> but eve if I don't make it, it's not worth the effort. It's not as if hair
> didn't get exported, just some of its curlyness set up into its child
> particles.
>

Ah! Ok. My first assumption was all wrong then.

There definitely are triangular faces in the file snippet you posted, 
although it's not possible to see whether the triangles are degenerate, 
because you only show the first vertex and I'd need to see the first 3 
vertices to be able to say whether the first triangle is degenerate (two or 
more vertices in the same place).

I now assume you're creating a surface and extruding the vertices in 
Blender, then exporting as an 'obj' file that you convert to POV-Ray using 
the excellent PoseRay utility written by FlyerX.

If this new assumption is correct, then the sample you posted must have 
contained some sort of surface defined in Blender when you exported it, 
otherwise you wouldn't get any faces in the mesh2 object.

When you export to Wavefront-obj format from Blender, the generated 'obj' 
file contains a set of 3 and/or 4 sided faces to represent surfaces and a 
series of 2-sided faces for the straight-line segments.  If you then convert 
this to POV-Ray using the PoseRay utility that FlyerX wrote, it converts any 
3 and 4 sided faces into triangular faces within a mesh2 object and ignores 
the 2-sided faces. This means that any 'hairs' created as extruded vertices 
forming a "long uninterrupted continuous series of edges" will be lost and 
you will end up with only the original surface from which they were 
extruded.

The good news is that the 'obj' file format can give you the 'edge' data you 
would need to reconstruct the 'hairs' in POV-Ray. To display these in 
POV-Ray you'll need a script to go through the 'obj' file looking for 
2-sided face definitions and adding a POV-Ray cylinder to represent each 
'edge'. Here's a simple 'obj' file I exported from Blender, having created a 
4-sided face (a plane) and extruded the 4 vertices. I then extruded the 
first of those 4 vertices a second time (f 9 5) giving a total of 5 edges.

# Blender3D v248 OBJ File: linetest2.obj.blend
# www.blender3d.org
mtllib linetest2.mtl
v 0.970005 -0.000000 -1.014998
v 0.970005 0.000000 0.985002
v -1.029996 0.000000 0.985002
v -1.029995 -0.000000 -1.014998
v 2.334797 -0.000000 -2.424784
v 0.445084 0.000000 1.599909
v -1.554916 0.000000 1.599909
v -1.554915 -0.000000 -0.400091
v 3.969549 -0.000000 -3.174670
usemtl (null)
s off
f 1 4 3 2
f 1 5
f 2 6
f 3 7
f 4 8
f 9 5

The 'obj' file shows the resulting 9 vertices. The 4-sided face uses 
vertices 1, 4, 3 and 2 and the five extruded 'hairs' are each represented as 
a 2-sided face. Writing a simple script to create a set of straight-line 
cylinders to represent these Blender 'edges' should be fairly 
straight-forward. If you wanted to get more sophisticated it would be 
possible to match up adjacent 'edges' to create a nice smooth spline, but 
this is likely to be significantly more complex.


If you used some other way to generate the code snippet you posted, then it 
is possible that it contains a sequence of degenerate triangles representing 
just the 'edges' (the 'hairs'). This would need a different solution to be 
able to see make it visible in a POV-Ray scene.

Regards,
Chris B.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.