![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 29 Aug 2000 12:24:28 -0400, Warp wrote:
> I have done this kind of triangle mesh "fixing" myself (in my triangle
>mesh smoother program).
> The idea is quite simple:
>
> 1. Take the first triangle and mark it as 'handled'.
>
> 2. Search all the triangles which are adjacent to this one and are
> not marked as 'handled'. An adjacent triangle is one that shares two
> vertices with this one.
>
> 3. Check if the adjacent triangle is ordered correctly. That is, if the
> shared vertices are listed in inverse order in the adjacent triangle than
> in the current triangle, then it's ok. If they are listed in the same
> order, then you have to swap the other triangle.
>
> 4. Now mark these adjacent triangles as 'handled' and for each one of them
> make recursively steps 2, 3 and 4 until no more triangles are found.
>
> 5. After that, search for some unhandled triangle. If the mesh consisted of
> one contiguous surface, you'll not find any, but you have to do this
> because the mesh may consist of several separate parts. If you find
> an unhandled triangle, make all steps 1, 2, 3, 4 and 5 for it.
>
>
> This works pretty well, but it's very slow, specially with big meshes.
>The slowest step is the second one (ie. the searching). There's probably some
>way of speeding it up using some tree structure or hash table.
You missed a step. After you finish all the surfaces, you have to make sure
they're correctly oriented. Even if it's just one surface, you have to
make sure you haven't inverted it.
The searching would be faster if each edge were a structure containing
pointers to the two triangles that share it. Building such a structure
would be O(n log n).
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
what kind of meshes does this work on? can it convert from regular to
mesh2?
Warp wrote:
>
> I have done this kind of triangle mesh "fixing" myself (in my triangle
> mesh smoother program).
> The idea is quite simple:
>
> 1. Take the first triangle and mark it as 'handled'.
>
> 2. Search all the triangles which are adjacent to this one and are
> not marked as 'handled'. An adjacent triangle is one that shares two
> vertices with this one.
>
> 3. Check if the adjacent triangle is ordered correctly. That is, if the
> shared vertices are listed in inverse order in the adjacent triangle than
> in the current triangle, then it's ok. If they are listed in the same
> order, then you have to swap the other triangle.
>
> 4. Now mark these adjacent triangles as 'handled' and for each one of them
> make recursively steps 2, 3 and 4 until no more triangles are found.
>
> 5. After that, search for some unhandled triangle. If the mesh consisted of
> one contiguous surface, you'll not find any, but you have to do this
> because the mesh may consist of several separate parts. If you find
> an unhandled triangle, make all steps 1, 2, 3, 4 and 5 for it.
>
> This works pretty well, but it's very slow, specially with big meshes.
> The slowest step is the second one (ie. the searching). There's probably some
> way of speeding it up using some tree structure or hash table.
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Nathan Kopp
Subject: Re: csg error with megapov's solid mesh?
Date: 29 Aug 2000 18:52:22
Message: <39ac3ea6@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"ryan constantine" <rco### [at] yahoo com> wrote...
> > >, or do i need to convert to mesh2? if so how? or can i use
> > > uv mapping? how?
> >
> > Yes.
>
> which? all?
Yes, you can use uv mapping. You do not have to convert to mesh2.
> i read it, but i'm a little foggy. as a regular mesh, there are no face
> entries right? unless i'm blind i only saw instructions for texturing
> mesh2 objects.
Are you looking in the MegaPov documentation or the official POV 3.1
documentation? I was referring to the 3.1 docs. From that documentation,
in the "Mesh Object" section, you'll read:
------ begin quote -------
Now let's begin. We will create a simple box with differently colored sides.
We create an empty file called meshdemo.pov and add the following lines.
camera {
location <20, 20, -50>
look_at <0, 5, 0>
}
light_source { <50, 50, -50> color rgb<1, 1, 1> }
#declare Red = texture {
pigment { color rgb<0.8, 0.2, 0.2> }
finish { ambient 0.2 diffuse 0.5 }
}
#declare Green = texture {
pigment { color rgb<0.2, 0.8, 0.2> }
finish { ambient 0.2 diffuse 0.5 }
}
#declare Blue = texture {
pigment { color rgb<0.2, 0.2, 0.8> }
finish { ambient 0.2 diffuse 0.5 }
}
We must declare all textures we want to use inside the mesh before the mesh
is created. Textures cannot be specified inside the mesh due to the poor
memory performance that would result.
Now we add the mesh object. Three sides of the box will use individual
textures while the other will use the global mesh texture.
mesh {
/* top side */
triangle { <-10, 10, -10>, <10, 10, -10>, <10, 10, 10>
texture { Red }
}
triangle { <-10, 10, -10>, <-10, 10, 10>, <10, 10, 10>
texture { Red }
}
/* bottom side */
triangle { <-10, -10, -10>, <10, -10, -10>, <10, -10, 10> }
triangle { <-10, -10, -10>, <-10, -10, 10>, <10, -10, 10> }
/* left side */
triangle { <-10, -10, -10>, <-10, -10, 10>, <-10, 10, 10> }
triangle { <-10, -10, -10>, <-10, 10, -10>, <-10, 10, 10> }
/* right side */
triangle { <10, -10, -10>, <10, -10, 10>, <10, 10, 10>
texture { Green }
}
triangle { <10, -10, -10>, <10, 10, -10>, <10, 10, 10>
texture { Green }
}
/* front side */
triangle { <-10, -10, -10>, <10, -10, -10>, <-10, 10, -10>
texture { Blue }
}
triangle { <-10, 10, -10>, <10, 10, -10>, <10, -10, -10>
texture { Blue }
}
/* back side */
triangle { <-10, -10, 10>, <10, -10, 10>, <-10, 10, 10> }
triangle { <-10, 10, 10>, <10, 10, 10>, <10, -10, 10> }
texture {
pigment { color rgb<0.9, 0.9, 0.9> }
finish { ambient 0.2 diffuse 0.7 }
}
}
--------- end quote --------
> is there a uv mapping tut' out there?
I don't think there currently is. Sorry.
-Nathan
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
thanks, i was thinking that uv mapping was megapov only so i was only
looking there. no i just have to figure out which tringle is which and
what i want to texture it with.
Nathan Kopp wrote:
>
> "ryan constantine" <rco### [at] yahoo com> wrote...
> > > >, or do i need to convert to mesh2? if so how? or can i use
> > > > uv mapping? how?
> > >
> > > Yes.
> >
> > which? all?
>
> Yes, you can use uv mapping. You do not have to convert to mesh2.
>
> > i read it, but i'm a little foggy. as a regular mesh, there are no face
> > entries right? unless i'm blind i only saw instructions for texturing
> > mesh2 objects.
>
> Are you looking in the MegaPov documentation or the official POV 3.1
> documentation? I was referring to the 3.1 docs. From that documentation,
> in the "Mesh Object" section, you'll read:
>
> ------ begin quote -------
> Now let's begin. We will create a simple box with differently colored sides.
> We create an empty file called meshdemo.pov and add the following lines.
>
> camera {
> location <20, 20, -50>
> look_at <0, 5, 0>
> }
> light_source { <50, 50, -50> color rgb<1, 1, 1> }
> #declare Red = texture {
> pigment { color rgb<0.8, 0.2, 0.2> }
> finish { ambient 0.2 diffuse 0.5 }
> }
> #declare Green = texture {
> pigment { color rgb<0.2, 0.8, 0.2> }
> finish { ambient 0.2 diffuse 0.5 }
> }
> #declare Blue = texture {
> pigment { color rgb<0.2, 0.2, 0.8> }
> finish { ambient 0.2 diffuse 0.5 }
> }
>
> We must declare all textures we want to use inside the mesh before the mesh
> is created. Textures cannot be specified inside the mesh due to the poor
> memory performance that would result.
>
> Now we add the mesh object. Three sides of the box will use individual
> textures while the other will use the global mesh texture.
>
> mesh {
> /* top side */
> triangle { <-10, 10, -10>, <10, 10, -10>, <10, 10, 10>
> texture { Red }
> }
> triangle { <-10, 10, -10>, <-10, 10, 10>, <10, 10, 10>
> texture { Red }
> }
> /* bottom side */
> triangle { <-10, -10, -10>, <10, -10, -10>, <10, -10, 10> }
> triangle { <-10, -10, -10>, <-10, -10, 10>, <10, -10, 10> }
> /* left side */
> triangle { <-10, -10, -10>, <-10, -10, 10>, <-10, 10, 10> }
> triangle { <-10, -10, -10>, <-10, 10, -10>, <-10, 10, 10> }
> /* right side */
> triangle { <10, -10, -10>, <10, -10, 10>, <10, 10, 10>
> texture { Green }
> }
> triangle { <10, -10, -10>, <10, 10, -10>, <10, 10, 10>
> texture { Green }
> }
> /* front side */
> triangle { <-10, -10, -10>, <10, -10, -10>, <-10, 10, -10>
> texture { Blue }
> }
> triangle { <-10, 10, -10>, <10, 10, -10>, <10, -10, -10>
> texture { Blue }
> }
> /* back side */
> triangle { <-10, -10, 10>, <10, -10, 10>, <-10, 10, 10> }
> triangle { <-10, 10, 10>, <10, 10, 10>, <10, -10, 10> }
> texture {
> pigment { color rgb<0.9, 0.9, 0.9> }
> finish { ambient 0.2 diffuse 0.7 }
> }
> }
> --------- end quote --------
>
> > is there a uv mapping tut' out there?
>
> I don't think there currently is. Sorry.
>
> -Nathan
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
ryan constantine wrote:
>
> thanks, i was thinking that uv mapping was megapov only so i was only
> looking there. no i just have to figure out which tringle is which and
> what i want to texture it with.
>
uv mapping is megapov only. For a tutorial on uv mapping, you can look
here: http://www.mediaport.net/Artichaud/Tran/sources/tutuve.htm
--
* Doctor Jekyll had something * mailto:ber### [at] iname com
* to Hyde... * http://www.enst.fr/~jberger
*******************************
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ron Parker <ron### [at] povray org> wrote:
: You missed a step. After you finish all the surfaces, you have to make sure
: they're correctly oriented. Even if it's just one surface, you have to
: make sure you haven't inverted it.
Well, this is an interesting question. How do you determine for a closed
mesh surface, which side is inside and which one is outside?
What about open mesh surfaces?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
ryan constantine <rco### [at] yahoo com> wrote:
: what kind of meshes does this work on? can it convert from regular to
: mesh2?
It reads a pov-file with meshes and writes and identical pov-file with
the same meshes, except that all the triangles are smooth_triangles. Everything
else is preserved.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 30 Aug 2000 10:14:04 -0400, Warp wrote:
>Ron Parker <ron### [at] povray org> wrote:
>: You missed a step. After you finish all the surfaces, you have to make sure
>: they're correctly oriented. Even if it's just one surface, you have to
>: make sure you haven't inverted it.
>
> Well, this is an interesting question. How do you determine for a closed
>mesh surface, which side is inside and which one is outside?
> What about open mesh surfaces?
Open mesh surfaces are impossible, but that's because the term "inside" has
no meaning for one.
For a closed mesh surface, fire a ray from outside the bounding box and check
the normal.
Some "well-behaved" "closed" surfaces will still fail; a 3-d projection of a
klein bottle, for example, would fail. Those are the fault of the modeler
and shouldn't concern us.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <slr### [at] fwi com>, ron### [at] povray org
wrote:
> Open mesh surfaces are impossible, but that's because the term
> "inside" has no meaning for one.
A height field is an open mesh surface with an "inside". :-)
Of course, it has a specific definition of "insideness", which I think
is "Any point below the surface".
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 30 Aug 2000 11:02:08 -0500, Chris Huff wrote:
>In article <slr### [at] fwi com>, ron### [at] povray org
>wrote:
>
>> Open mesh surfaces are impossible, but that's because the term
>> "inside" has no meaning for one.
>
>A height field is an open mesh surface with an "inside". :-)
>Of course, it has a specific definition of "insideness", which I think
>is "Any point below the surface".
Lots of open surfaces have "insides." Consider, for example, an open cylinder
or a clipped object. But those are a matter of definition and might not do
what you expect them to in CSG.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |