 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 10/10/2025 13:22, Kenneth wrote:
> It seems that the resulting mesh2 triangles are facing 'inside out'-- the
> insides face outside and vice versa. See my attached render of an STL (binary)
> file that I uploaded to your page and converted tonight.
> ...
Thanks you for this bug report, I have just tried to reproduce this
behavior and didn't found any difference between images with forward and
backward faces order. Could you please send me a simple example,
illustrating this issue ? For simplicity, please find a 'cube.fbx'
in attachment - you can use it with my converter.
--
YB
Post a reply to this message
Attachments:
Download 'cube.fbx.dat' (18 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
yesbird wrote:
> On 10/10/2025 13:22, Kenneth wrote:
> > It seems that the resulting mesh2 triangles are facing 'inside out'...
> > ...
>
> Thanks you for this bug report, I have just tried to reproduce this
> behavior and didn't found any difference between images with forward and
> backward faces order. Could you please send me a simple example,
> illustrating this issue ? For simplicity, please find a 'cube.fbx'
> in attachment - you can use it with my converter.
> --
I just tried uploading 'cube.fbx' to your converter, but it does not load there.
This *might* be because it showed up as 'cube.fbx.dat' for me when I initially
downloaded it here. (This is typical behavior of the Pov-ray newsgroup website
that I use, regarding downloads; a .dat container is appended to all files.
Unfortunately, I cannot strip that addition from the file, for re-uploading to
your converter.) But I don't know if this is the actual cause of the problem; it
is just my guess.
I have attached one of my recent STL-to-mesh2 conversions from your site
as an .inc file-- a model originally from Thingiverse-- to illustrate the
inside-out triangle result. When rendered in POV-ray, it needs both a texture
and an interior_texture, so that the latter will show the problem. (When using
just a typical texture alone, the triangles' insides and outsides look the
SAME...which gives a false impression of the situation.)
Post a reply to this message
Attachments:
Download 'test_model_stl_to_mesh2_conversion.inc.txt' (701 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 13/10/2025 14:03, Kenneth wrote:
> I just tried uploading 'cube.fbx' to your converter, but it does not load there.
> ...
Thanks for testing, could you please take file from here
and try again ?
https://drive.google.com/file/d/19i3tetZYJzlKQcOPR_rUEI1n-m2LCwtS/view?usp=drive_link
>
> I have attached one of my recent STL-to-mesh2 conversions from your site
> ...
Sorry, but without complete scene with textures I can't reproduce it -
still confused. But now you can export model with arrays and make
desired perturbations as Bill suggested - just select 'Export arrays'
at low-left corner.
--
YB
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
yesbird wrote:
> On 13/10/2025 14:03, Kenneth wrote:
> > I just tried uploading 'cube.fbx' to your converter, but it does not load there.
> > ...
>
> Thanks for testing, could you please take file from here
> and try again ?
>
YES, that worked; and thanks for that cube object, because I was able to
discover what is causing the inside-out-triangles problem...and the confusion
for both you and me! I made two conversion tests (deleting your 'material' and
substituting a texture plus an interior texture.)
When I convert it to SMOOTH triangles (the default at your conversion site), the
cube appears CORRECT as to inside/outside colors. That surprised me.
When I convert it to FLAT triangles, the inside/outside is *reversed*. (This is
how I have been converting objects there, and I did not know until now that the
two schemes produced different results.)
I have attached a POV-ray scene file to show both of the examples side by side.
The green cube is the smooth-triangle version; the red one is flat triangles.
From examining both of the mesh2 code examples, it is not clear to me why the
two results should be different-- although I am not very knowledgeable about
mesh2 syntax.
Anyway, at least *part* of the mystery has been cleared up :-D
-----------
In my opinion, the 'union' at the end of the converted file(s) is not really
necessary, nor is the 'part1' object there. The converted .inc file by itself
would be easier to render in one of our scenes, just by #including it there.
Post a reply to this message
Attachments:
Download 'cube as smooth vs flat triangles.pov.txt' (4 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Kenneth" <kdw### [at] gmail com> wrote:
> When I convert it to SMOOTH triangles (the default at your conversion site), the
> cube appears CORRECT as to inside/outside colors. That surprised me.
>
> When I convert it to FLAT triangles, the inside/outside is *reversed*.
I'm going to just speculate that since mesh2 and smooth_triangle both allow the
user to specify what the normal vector is, then perhaps that overrides whatever
normal would be calculated based upon the ordering of the vertices.
- BW
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 13/10/2025 20:24, Bald Eagle wrote:
> I'm going to just speculate that since mesh2 and smooth_triangle both allow the
> user to specify what the normal vector is, then perhaps that overrides whatever
> normal would be calculated based upon the ordering of the vertices.
You are absolutely right. I've just reversed vertices order, and it
works fine now.
--
YB
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 13/10/2025 19:58, Kenneth wrote:
> YES, that worked; and thanks for that cube object, ...
Always welcome, now this testing cube is available at [1] button.
> Anyway, at least *part* of the mystery has been cleared up :-D
The answer is simple: order of vertices define normal direction.
When normals specified, they overwrite this calculation. I've just
reversed vertices order, and it works fine now (check it, please).
> In my opinion, the 'union' at the end of the converted file(s) is not really
> necessary, nor is the 'part1' object there. The converted .inc file by itself
> would be easier to render in one of our scenes, just by #including it there.
I am using unions to reflect the structure of the original scene for
technical purposes. Using objects is necessary for materials assignment
to different parts (meshes) of complex models. But if you see an
alternative and better solution, please share your thoughts.
--
YB
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
yesbird wrote:
> On 13/10/2025 19:58, Kenneth wrote:
> > YES, that worked; and thanks for that cube object, ...
>
> I've just
> reversed vertices order, and it works fine now (check it, please).
YES, both the smooth and flat versions render correctly now; the outsides and
insides are where they should be! Excellent.
>
>
> I am using unions to reflect the structure of the original scene for
> technical purposes. Using objects is necessary for materials assignment
> to different parts (meshes) of complex models.
Ah yes, I understand now. For my own purposes, I will just delete the unions.
---------
For your 'materials', are you using your own creations? I would suggest using
the standard textures that come with POV-ray instead, available in its 'include'
folder (perhaps in 'textures.inc', 'glass.inc', etc.) For example, your
'M_yellow_green_gloss' material is not included in POV-ray as far as I can tell,
and could be confusing to a user when first trying to render the mesh2. (It also
causes an error.)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 14/10/2025 03:26, Kenneth wrote:
> For your 'materials', are you using your own creations? I would suggest using
> the standard textures that come with POV-ray instead, available in its 'include'
> folder (perhaps in 'textures.inc', 'glass.inc', etc.) For example, your
> 'M_yellow_green_gloss' material is not included in POV-ray as far as I can tell,
> and could be confusing to a user when first trying to render the mesh2. (It also
> causes an error.)
I guess it's time to write a help system :). Short notes about how to
use the studio and materials available by clicking (?).
I mentioned somewhere, that these materials are from Mike Miller's
collection. To browse them please enter materials directory and render
'samples_default.pov' (http://localhost:8085/data/download/studio.zip).
You are absolutely right about standard materials, I will include them
in my library later, after finishing main functionality. In general,
preparing materials is a simple, but time consuming task, moreover I
need to adjust lighting for better matcap rendering. Any assistance
related to this part of the project is highly appreciated. :)
--
YB
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 14/10/2025 03:45, yesbird wrote:
> I mentioned somewhere, that these materials are from Mike Miller's
> collection. To browse them please enter materials directory and render
> 'samples_default.pov' (http://localhost:8085/data/download/studio.zip).
Sorry, it's time to sleep :):
https://povlab.yesbird.online/studio/data/download/studio.zip
--
YB
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |