POV-Ray : Newsgroups : povray.binaries.images : Le Forgeron: experiments Server Time
6 Oct 2024 09:23:32 EDT (-0400)
  Le Forgeron: experiments (Message 62 to 71 of 71)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: LanuHum
Subject: Re: Le Forgeron: experiments
Date: 4 Sep 2016 09:15:00
Message: <web.57cc1d431d798e7f7a3e03fe0@news.povray.org>
Not all objects can I simulate in Blender.
Tesselation - this is what you need.
Today I wrote gts import. Later, I will write an automatic converter.
Most of all I'm interested in the object blob.
Tessel and tesselate give a bad result. Others get well.


            items=[("bourke", "bourke", ""),
                   ("cristal", "cristal", ""),
                   ("cubicle", "cubicle", ""),
                   ("heller", "heller", ""),
                   ("tessel", "tessel", ""),
                   ("tesselate", "tesselate", "")],


#version 3.7;

#include "functions.inc"
global_settings {
    assumed_gamma 1.000000
    max_trace_level 3
    charset utf8
}
sky_sphere {
    pigment {rgb<0.051, 0.051, 0.051>}
}

#declare Default_texture = texture{pigment {rgb 0.8}}

#declare data_Blob_ob = blob {
    threshold 0.6
    sphere { <0,0,0>, 1.702, 2 texture {Default_texture}
    matrix <1.000000, 0.000000, 0.000000,  0.000000, -0.000000, -1.000000,
0.000000, 1.000000, -0.000000,  0.000000, 0.000000, 0.000000>
    }
    sphere { <0,0,0>, 1.702, 2 texture {Default_texture}
    matrix <1.000000, 0.000000, 0.000000,  0.000000, -0.000000, -1.000000,
0.000000, 1.000000, -0.000000,  0.905406, 0.181065, -1.091782>
    }
}
#declare Test = tesselate {original data_Blob_ob accuracy 50 texture{pigment
{rgb 0.8}}}
//object{Test}
gts_save { "/home/leonid/test.gts",Test}
light_source {
    <4.08,5.9,-1.01>
    color rgb<1, 1, 1>
    fade_distance 29.9999828339
    fade_power 1
}
camera {
    perspective
    location  <0,0,0>
    look_at  <0,0,-1>
    right <-1.7777777777777777, 0, 0>
    up <0, 1, 0>
    angle  49.134343
    rotate  <-26.440706, 46.691945, -0.000003>
    translate <7.481132, 5.343666, 6.507640>
}


Post a reply to this message


Attachments:
Download 'tesselation.jpg' (375 KB)

Preview of image 'tesselation.jpg'
tesselation.jpg


 

From: Le Forgeron
Subject: Re: Le Forgeron: experiments
Date: 4 Sep 2016 13:37:38
Message: <57cc5be2@news.povray.org>
Le 04/09/2016 à 15:10, LanuHum a écrit :
> Not all objects can I simulate in Blender.
> Tesselation - this is what you need.
> Today I wrote gts import. Later, I will write an automatic converter.
> Most of all I'm interested in the object blob.
> Tessel and tesselate give a bad result. Others get well.
> 

Thanks for spotting a bug in tessel and tesselate.

Now patched to get a closed surface.


Post a reply to this message


Attachments:
Download 'after.png' (94 KB) Download 'before.png' (102 KB)

Preview of image 'after.png'
after.png

Preview of image 'before.png'
before.png


 

From: LanuHum
Subject: Re: Le Forgeron: experiments
Date: 8 Mar 2017 13:30:00
Message: <web.58c04cc81d798e7f7a3e03fe0@news.povray.org>
Hello!
Good idea: load binary file format.
But object has no color. :(

#version 3.7;

#include "functions.inc"
global_settings {
    assumed_gamma 1.000000
    max_trace_level 3
    charset utf8
}
sky_sphere {
    pigment {rgb<0.051, 0.051, 0.051>}
}

#declare Default_texture = texture{pigment {rgb 0.8}}

#declare Material = texture{
    pigment{color srgbft <0.8000,0.8000,0.8000,0.0000,0.0000>}
    finish{
        diffuse 0.8000
        brilliance 1.8000
          }
}

stl_load { "/home/leonid/untitled.stl" }

light_source {
    <4.08,5.9,-1.01>
    color rgb<1, 1, 1>
    fade_distance 29.9999828339
    fade_power 1
}
camera {
    perspective
    location  <0,0,0>
    look_at  <0,0,-1>
    right <-1.7777777777777777, 0, 0>
    up <0, 1, 0>
    angle  49.134343
    rotate  <-27.098163, 46.688390, -0.903519>
    translate <7.481132, 5.343666, 6.507640>
}

untitled.stl in attachment.


Post a reply to this message


Attachments:
Download 'untitled.stl.dat' (1 KB)

From: LanuHum
Subject: Re: Le Forgeron: experiments
Date: 8 Mar 2017 13:50:01
Message: <web.58c0512e1d798e7f7a3e03fe0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:
> Hello!
> Good idea: load binary file format.
> But object has no color. :(
>
> #version 3.7;
>
> #include "functions.inc"
> global_settings {
>     assumed_gamma 1.000000
>     max_trace_level 3
>     charset utf8
> }
> sky_sphere {
>     pigment {rgb<0.051, 0.051, 0.051>}
> }
>
> #declare Default_texture = texture{pigment {rgb 0.8}}
>
> #declare Material = texture{
>     pigment{color srgbft <0.8000,0.8000,0.8000,0.0000,0.0000>}
>     finish{
>         diffuse 0.8000
>         brilliance 1.8000
>           }
> }
>
> stl_load { "/home/leonid/untitled.stl" }
>
> light_source {
>     <4.08,5.9,-1.01>
>     color rgb<1, 1, 1>
>     fade_distance 29.9999828339
>     fade_power 1
> }
> camera {
>     perspective
>     location  <0,0,0>
>     look_at  <0,0,-1>
>     right <-1.7777777777777777, 0, 0>
>     up <0, 1, 0>
>     angle  49.134343
>     rotate  <-27.098163, 46.688390, -0.903519>
>     translate <7.481132, 5.343666, 6.507640>
> }
>
> untitled.stl in attachment.

stl_load { "/home/leonid/untitled.stl" texture { Material }}
But, the cube can have different textures for each polygon.
It would be nice to use a texture_list.


Post a reply to this message

From: Le Forgeron
Subject: Re: Le Forgeron: experiments
Date: 8 Mar 2017 14:41:06
Message: <58c05e52@news.povray.org>
Le 08/03/2017 à 19:45, LanuHum a écrit :
> stl_load { "/home/leonid/untitled.stl" texture { Material }}
> But, the cube can have different textures for each polygon.
> It would be nice to use a texture_list.
> 

And which version of STL would you use ?
There is 2 incompatible format for color encoding (in binaray STL):
* As stated on wikipedia:  generic STL file reader cannot automatically
distinguish between them.
* 2 "attribute byte count" bytes at the end of every triangle store a
15-bit rgb color information
** bits 0-4 for blue, bits 5-9 for green, bits 10-14 for red, bit 15 set
when color is valid
** bits 0-4 for red, bits 5-9 for green, bits 10-14 for blue, bit 15
unset when color is local, set to use global
* the header (80 bytes) can have overall color specification (only for
the latter encoding)
** but it can have COLOR=RGBA or/and MATERIAL= with 12 bytes for diffuse
reflection, specular highlight and ambient light

The stl_load-ed object is an usual povray shape: immerge it in whatever
texture/pattern you want.
(actually, it's a mesh once loaded, but there is no uv coordinates in
STL to help you)

And to make things funnier, no one as a clue about the 15 bit color
space: is it linear or gamma corrected ? (and which correction)

happy reading :

https://en.wikipedia.org/wiki/STL_(file_format)


Post a reply to this message

From: LanuHum
Subject: Re: Le Forgeron: experiments
Date: 8 Mar 2017 15:30:00
Message: <web.58c068df1d798e7f7a3e03fe0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 08/03/2017 à 19:45, LanuHum a écrit :
> > stl_load { "/home/leonid/untitled.stl" texture { Material }}
> > But, the cube can have different textures for each polygon.
> > It would be nice to use a texture_list.
> >
>
> And which version of STL would you use ?
> There is 2 incompatible format for color encoding (in binaray STL):
> * As stated on wikipedia:  generic STL file reader cannot automatically
> distinguish between them.
> * 2 "attribute byte count" bytes at the end of every triangle store a
> 15-bit rgb color information
> ** bits 0-4 for blue, bits 5-9 for green, bits 10-14 for red, bit 15 set
> when color is valid
> ** bits 0-4 for red, bits 5-9 for green, bits 10-14 for blue, bit 15
> unset when color is local, set to use global
> * the header (80 bytes) can have overall color specification (only for
> the latter encoding)
> ** but it can have COLOR=RGBA or/and MATERIAL= with 12 bytes for diffuse
> reflection, specular highlight and ambient light
>
> The stl_load-ed object is an usual povray shape: immerge it in whatever
> texture/pattern you want.
> (actually, it's a mesh once loaded, but there is no uv coordinates in
> STL to help you)
>
> And to make things funnier, no one as a clue about the 15 bit color
> space: is it linear or gamma corrected ? (and which correction)
>
> happy reading :
>
> https://en.wikipedia.org/wiki/STL_(file_format)

No,no,no. Only idea. STL as base.
We can write an string array at the end of the file:
mesh_materials=['glass','wood','metal']
We can write an integer array at the end of the file:
face_material_indexes=[mesh_materials[0],mesh_materials[2],mesh_materials[1],mesh_materials[1],mesh_materials[2],mesh_m
aterials[0]]
If it is written to a file, you can change the parser.
Now in .pov
#declare Metal = texture{}
#declare Wood = texture{}
#declare Glass = texture{}
#declare My = texture_list{3,texture{Metal},texture{Wood},texture{Glass}}
stl_load{filename,texture_list{My}}


Post a reply to this message

From: Le Forgeron
Subject: Re: Le Forgeron: experiments
Date: 8 Mar 2017 17:25:20
Message: <58c084d0$1@news.povray.org>
Le 08/03/2017 à 21:26, LanuHum a écrit :
> No,no,no. Only idea. STL as base.
> We can write an string array at the end of the file:

IMHO, no.
STL is not extensible.
It was designed in the 80's, without provision (at least in binary) for
extensions.
The added trailer is probably going to be lost when edited by any
program supporting STL... if it can load it at all.

If you want to design a new file format, go for it, but you cannot call
it STL.

If only povray can read your file, what about using the normal scene
language of mesh or mesh2 ?

The loaded STL can be exported with some macro to explore the relevant
mesh, see "Access to data of mesh", top of the page :

https://bitbucket.org/LeForgeron/povray/wiki/Object

(the export is left as an exercise for the reader)


Post a reply to this message

From: LanuHum
Subject: Re: Le Forgeron: experiments
Date: 9 Mar 2017 10:55:00
Message: <web.58c179e31d798e7f7a3e03fe0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
>
> If only povray can read your file, what about using the normal scene
> language of mesh or mesh2 ?
>

If I have time to model and animate, then I will use hg-povray.
I'm interested in experiments with tessellation. :)
But... using the normal scene language of mesh or mesh2... This is the fastest
way to load an object into a scene? Is there a way to speed it up? :)


Post a reply to this message

From: Le Forgeron
Subject: Re: Le Forgeron: experiments
Date: 9 Mar 2017 11:52:29
Message: <58c1884d$1@news.povray.org>
Le 09/03/2017 à 16:50, LanuHum a écrit :
> Le_Forgeron <jgr### [at] freefr> wrote:
>>
>> If only povray can read your file, what about using the normal scene
>> language of mesh or mesh2 ?
>>
> 
> If I have time to model and animate, then I will use hg-povray.
> I'm interested in experiments with tessellation. :)
> But... using the normal scene language of mesh or mesh2... This is the fastest
> way to load an object into a scene? Is there a way to speed it up? :)
> 
> 
The fastest is mesh2, because it is as near as the internal data as
possible.

Everything else need to search each new item in the already loaded part,
which mean the loading process is something O(n²) or at least
O(n.log(n)) when mesh2 is O(n).

So, the less triangles, the better.

GTS & STL have the advantage of avoiding text parsing, for the binary
format, yet the transformation into internal data need to perform search
on unsorted data so they get O(n²) performance as the number of
triangles increases it starts to suck (or slowdown enough to be noticed).

mesh syntax cumulate the drawbacks: text parsing and repeated search.

The real fast would be a binary serialization of the internal data, but
that is not available (yet ? do not hold your breath for it); and no
actual editor would be able to handle it (and it would be yet another
file format)

My rule of thumb:
* small mesh, you can use gts or stl.
* really huge number of triangles, you better load via mesh2 syntax

The power of your I/O, CPU, memory and your patience draw the line
between small and huge.


Post a reply to this message

From: LanuHum
Subject: Re: Le Forgeron: experiments
Date: 9 Mar 2017 12:55:00
Message: <web.58c193e91d798e7f7a3e03fe0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 09/03/2017 à 16:50, LanuHum a écrit :
> > Le_Forgeron <jgr### [at] freefr> wrote:
> >>
> >> If only povray can read your file, what about using the normal scene
> >> language of mesh or mesh2 ?
> >>
> >
> > If I have time to model and animate, then I will use hg-povray.
> > I'm interested in experiments with tessellation. :)
> > But... using the normal scene language of mesh or mesh2... This is the fastest
> > way to load an object into a scene? Is there a way to speed it up? :)
> >
> >
> The fastest is mesh2, because it is as near as the internal data as
> possible.
>
> Everything else need to search each new item in the already loaded part,
> which mean the loading process is something O(n²) or at least
> O(n.log(n)) when mesh2 is O(n).
>
> So, the less triangles, the better.
>
> GTS & STL have the advantage of avoiding text parsing, for the binary
> format, yet the transformation into internal data need to perform search
> on unsorted data so they get O(n²) performance as the number of
> triangles increases it starts to suck (or slowdown enough to be noticed).
>
> mesh syntax cumulate the drawbacks: text parsing and repeated search.
>
> The real fast would be a binary serialization of the internal data, but
> that is not available (yet ? do not hold your breath for it); and no
> actual editor would be able to handle it (and it would be yet another
> file format)
>
> My rule of thumb:
> * small mesh, you can use gts or stl.
> * really huge number of triangles, you better load via mesh2 syntax
>
> The power of your I/O, CPU, memory and your patience draw the line
> between small and huge.

Thanks!
Probably, I need here:
http://www.amd.com/en/ryzen
:))))
While I'm collecting money, I need to work with tessellation so that the mesh
transformed object is automatically loaded into the Blender for new
transformations and new tesselations. Perhaps, interesting results will be
obtained.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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