STL file generation non-deterministic?

classic Classic list List threaded Threaded
42 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

Giles Bathgate-2
On 16 March 2012 16:13, nop head <[hidden email]> wrote:
> Ah, thanks. Perhaps I will use that, although it is handy to know which STL
> files have changed from one version to another.

"But there is a hole in my bucket dear lizer dear lizer."

Well this is the problem as you stated at the begining, you can't
really tell whats changed from version to version in the STL files
because openscad/cgal exports them with random changes anyway...

I am sure there is a way to fix this, you can configure the CGAL
kernel to use a different trait for making the identifiers or
something like that is what I remember.

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

clothbot
On 2012-03-16, at 12:18 PM, Giles Bathgate wrote:
On 16 March 2012 16:13, nop head <[hidden email]> wrote:
Ah, thanks. Perhaps I will use that, although it is handy to know which STL
files have changed from one version to another.

"But there is a hole in my bucket dear lizer dear lizer."

Well this is the problem as you stated at the begining, you can't
really tell whats changed from version to version in the STL files
because openscad/cgal exports them with random changes anyway...

I am sure there is a way to fix this, you can configure the CGAL
kernel to use a different trait for making the identifiers or
something like that is what I remember.

A quick way to do it with minimal impact might be to geometrically pre-sort the facets in export_stl() before writing them out.  Start at (minX,minY,minZ) and work your way thru Z, then Y, then X so all the geometry is presented in the same relative order.

Andrew.

--

"The future is already here.  It's just not very evenly distributed" -- William Gibson

Me: http://clothbot.com/wiki/



Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

Alan Cox
In reply to this post by Nick Pelling
> Sorry to have to say the obvious, but isn't this a bit rubbish? Don't
> get me wrong, it's great that I can use scripts to build CSG-based
> demos: but as for them being monochrome, I'm not hugely impressed. :-(

Send improvements.

For 3D print type uses it is currently fine.

Alan

Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

Taylor Alexander
Color would be nice as a means of labelling certain features in the preview.

I was recently modifying someone else's OpenSCAD file and it was horribly difficult to figure out which features were where in the code. If some holes were blue, some were red, etc, I could search for those in the file.

So it can be great for use in the preview if people use it properly. Though I wish I could just click on a face in the preview and have it highlight which section of code did that...

-Taylor

On Fri, Mar 16, 2012 at 4:04 PM, Alan Cox <[hidden email]> wrote:
> Sorry to have to say the obvious, but isn't this a bit rubbish? Don't
> get me wrong, it's great that I can use scripts to build CSG-based
> demos: but as for them being monochrome, I'm not hugely impressed. :-(

Send improvements.

For 3D print type uses it is currently fine.

Alan
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

nophead
In reply to this post by Alan Cox
You can colour the CGAL after rendering. That is how I do the Mendel90. All the vitamins and printed parts have a render statement and colour is applied afterwards. It still disappears when you hit F6 to export it, but there is no colour in an STL file anyway.



On 16 March 2012 23:04, Alan Cox <[hidden email]> wrote:
> Sorry to have to say the obvious, but isn't this a bit rubbish? Don't
> get me wrong, it's great that I can use scripts to build CSG-based
> demos: but as for them being monochrome, I'm not hugely impressed. :-(

Send improvements.

For 3D print type uses it is currently fine.

Alan
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

donbright
In reply to this post by Nick Pelling
I think it might be possible to get CGAL to do colors. Every
half-facet in a CGAL NEF Polyhedron has a 'mark' ,indicating if it is
'inside' and which is 'outside'. This is how the 'holes' are colored
green and 'body' is colored yellow, if i am not mistaken, during
render.

In theory, you could maybe subclass or modify the CGAL Nef Polyhedron
type to add 'color' to the CGAL data structure so that each
'half-facet' would get a 'color' in addition to a 'mark'.

Then you have to decide what happens during 'intersection' and 'union'
which has been discussed before on this mailing list. I guess for
starters you could just use the same algorithm that OpenCSG uses (no
idea what that is btw) and see if that could be transliterated into to
CGAL.

Then you need (as mentioned) some output format that can do color. if
i tried it itd probably take at least 200 hours work, but im kinda
slow.

-db


On Fri, Mar 16, 2012 at 10:40 AM, Nick Pelling
<[hidden email]> wrote:

> Hi Giles & whosawhatsis,
>
> Ah, I see. So OpenSCAD lets you use color when you don't need it
> (preview), but not when you do (final). And even though CGAL itself
> does seem to support color (please correct me if I'm wrong).
>
> Sorry to have to say the obvious, but isn't this a bit rubbish? Don't
> get me wrong, it's great that I can use scripts to build CSG-based
> demos: but as for them being monochrome, I'm not hugely impressed. :-(
>
> Cheers, ....Nick....
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

donbright
In reply to this post by clothbot
"I have also seen some normal values changing from zero to something
very close to zero."

is part of the problem that win32, win64, linux32, linux64 *bsd, amd,
intel, ppc, arm, etc, are all using diff code paths to convert from
GMP (which stores integer fractions) into floating point numbers?

Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

nophead
This is on the same machine, with the same source code built in two different directories.

On 17 March 2012 00:09, Don Bright <[hidden email]> wrote:
"I have also seen some normal values changing from zero to something
very close to zero."

is part of the problem that win32, win64, linux32, linux64 *bsd, amd,
intel, ppc, arm, etc, are all using diff code paths to convert from
GMP (which stores integer fractions) into floating point numbers?
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

kintel
Administrator
In reply to this post by Taylor Alexander
On Mar 17, 2012, at 00:20 AM, Taylor Alexander wrote:
>
> [...] Though I wish I could just click on a face in the preview and have it highlight which section of code did that...
>
Yeah - I would like to see that!

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

Taylor Alexander


On Mar 16, 2012 7:43 PM, "Marius Kintel" <[hidden email]> wrote:
>
> On Mar 17, 2012, at 00:20 AM, Taylor Alexander wrote:
> >
> > [...] Though I wish I could just click on a face in the preview and have it highlight which section of code did that...
> >
> Yeah - I would like to see that!
>

Yup! That's one of the hardest things for me moving from solidworks to editing openSCAD files. In solidworks if I want to change a hole, I right click on it and boom. In OpenSCAD I have to scour the file for what might be responsible for the hole. It took me an hour to change a few hole sizes! A "find" function in the editor would be super helpful too. But I just joined the mailing list, so I'll start a thread about some issues in a few days.

>  -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad

Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

tjhowse
Taylor: I strongly suggest you investigate using an external editor when playing with OpenSCAD. Set it to "Automatic reload and compile", then open the .scad file in something like notepad++ (for windows). I would never dream of using the built-in text editor for anything other than "let's see how fast I can write the scad code to generate a willy".

On 17 March 2012 12:48, Taylor Alexander <[hidden email]> wrote:


On Mar 16, 2012 7:43 PM, "Marius Kintel" <[hidden email]> wrote:
>
> On Mar 17, 2012, at 00:20 AM, Taylor Alexander wrote:
> >
> > [...] Though I wish I could just click on a face in the preview and have it highlight which section of code did that...
> >
> Yeah - I would like to see that!
>

Yup! That's one of the hardest things for me moving from solidworks to editing openSCAD files. In solidworks if I want to change a hole, I right click on it and boom. In OpenSCAD I have to scour the file for what might be responsible for the hole. It took me an hour to change a few hole sizes! A "find" function in the editor would be super helpful too. But I just joined the mailing list, so I'll start a thread about some issues in a few days.

>  -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

Giles Bathgate-2
In reply to this post by nophead

Can you give examples of diffs between two different exports.

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

Taylor Alexander
In reply to this post by tjhowse


On Fri, Mar 16, 2012 at 8:40 PM, tjhowse <[hidden email]> wrote:
Taylor: I strongly suggest you investigate using an external editor when playing with OpenSCAD. Set it to "Automatic reload and compile", then open the .scad file in something like notepad++ (for windows). I would never dream of using the built-in text editor for anything other than "let's see how fast I can write the scad code to generate a willy".

Hah, yes, I saw that option and figured that was the intention. Still, it seems a bit silly. A text editor is such a simple thing, you'd think the one included could be made to be sufficient. 


On 17 March 2012 12:48, Taylor Alexander <[hidden email]> wrote:


On Mar 16, 2012 7:43 PM, "Marius Kintel" <[hidden email]> wrote:
>
> On Mar 17, 2012, at 00:20 AM, Taylor Alexander wrote:
> >
> > [...] Though I wish I could just click on a face in the preview and have it highlight which section of code did that...
> >
> Yeah - I would like to see that!
>

Yup! That's one of the hardest things for me moving from solidworks to editing openSCAD files. In solidworks if I want to change a hole, I right click on it and boom. In OpenSCAD I have to scour the file for what might be responsible for the hole. It took me an hour to change a few hole sizes! A "find" function in the editor would be super helpful too. But I just joined the mailing list, so I'll start a thread about some issues in a few days.

>  -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

Triffid Hunter
On Sat, Mar 17, 2012 at 6:41 PM, Taylor Alexander <[hidden email]> wrote:
Hah, yes, I saw that option and figured that was the intention. Still, it seems a bit silly. A text editor is such a simple thing, you'd think the one included could be made to be sufficient.

it is sufficient, but there's no point making a very elaborate one when elaborate ones already exist, and people are already used to them. personally I think this is a brilliant and elegant option, certainly better than having to get used to yet another editor!
Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

Taylor Alexander
I don't consider it elegant to include a shoddy text editor in a program to encourage users to run two programs at once.

Its not a bad hack to avoid having to write a real text editor, but its far from elegant.

If no text editor is necessary, the app shouldn't include one. If a text editor is included, it should have basic features like find. Its great that there is an option for users to use their own editor, but if there is any text editor at all, it should work on its own for basic users. I don't consider a text editor that lacks a find function to be sufficient at all.

These are general principles of engineering - make a feature work properly, or don't include it. Anything else is bad engineering (which still happens very often). But the simple text editor included in an app based largely around text editing should at least match the features of, say, Windows Notepad.

If not for any reason other than it will annoy new users.

-Taylor

On Sat, Mar 17, 2012 at 12:54 AM, Triffid Hunter <[hidden email]> wrote:
On Sat, Mar 17, 2012 at 6:41 PM, Taylor Alexander <[hidden email]> wrote:
Hah, yes, I saw that option and figured that was the intention. Still, it seems a bit silly. A text editor is such a simple thing, you'd think the one included could be made to be sufficient.

it is sufficient, but there's no point making a very elaborate one when elaborate ones already exist, and people are already used to them. personally I think this is a brilliant and elegant option, certainly better than having to get used to yet another editor!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

stonysmith
In reply to this post by Nick Pelling
To raise an old discussion: VRML supports color just fine, and doesn't appear to be all that complicated of a format.

> Subject: Re: [OpenSCAD] Keyword 'color' not working in Windows
> From: Don Bright <[hidden email]>
> Then you need (as mentioned) some output format that can do color.
Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

nophead
In reply to this post by Giles Bathgate-2
Here is the simplest case. It is just the difference between two cylinders. 99% of the file is the same, just four facets in a different order.



On 17 March 2012 05:43, Giles Bathgate <[hidden email]> wrote:

Can you give examples of diffs between two different exports.

Regards

Giles


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad



diff.txt (1K) Download Attachment
pcb_spacer.stl (50K) Download Attachment
pcb_spacer.stl (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Keyword 'color' not working in Windows OpenSCAD?

nophead
In reply to this post by stonysmith
On the subject of the editor: it no longer seems to highlight syntax errors, possible because the line numbers are no longer right. It makes finding a syntax error in a large project like finding a needle in a haystack.

I think the reported line numbers don't take included files into account.

On 17 March 2012 10:04, <[hidden email]> wrote:
To raise an old discussion: VRML supports color just fine, and doesn't appear to be all that complicated of a format.

> Subject: Re: [OpenSCAD] Keyword 'color' not working in Windows
> From: Don Bright <[hidden email]>
> Then you need (as mentioned) some output format that can do color.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

Laszlo KREKACS
In reply to this post by Brad Pitcher
Think to .stl files as .png files in a program. Or music files in a game.
Should it be also separately downloaded?

It would rather be cumbersome to download the sourcecode and download the
images from other places, and download the music separately, etc.

The .stl files are rather useful to be included. Lets suppose the
models are includes both imperial and metric bolts, and depends on the
configuration which one you want to generate. So having a pregenerated
.stl file is rather useful if you only want to take and print a model without
reading through the sourcecode.

Best,
 Laszlo


On Fri, Mar 16, 2012 at 4:47 PM, Brad Pitcher <[hidden email]> wrote:

> In my opinion, the STL files for a project should be packaged in releases,
> just as with software binaries, and never checked in to source control.
>
>
>
> On Fri, Mar 16, 2012 at 7:56 AM, nop head <[hidden email]> wrote:
>>
>> Yes they are really but not everybody would want to install the source and
>> build just to print a set of parts.
>>
>> On 16 March 2012 14:48, Giles Bathgate <[hidden email]> wrote:
>>>
>>> In this scenario I think of stl as binarys that you wouldn't usually
>>> check into source control. I am sure we can figure out how to get cgal to be
>>> more predictable in the future.
>>>
>>> Regards
>>>
>>> Giles
>>>
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>>
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>

Reply | Threaded
Open this post in threaded view
|

Re: STL file generation non-deterministic?

nophead
In reply to this post by nophead
It seems that OpenCSG PNG generation is also non-deterministic. Odd pixels
change at the edges on consecutive runs on the same computer. Perhaps it is
related to the STL problem. I.e. perhaps the tessellation is
non-deterministic and that leads to slightly different jaggies on diagonal
lines when the triangles are drawn.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
123