working with a complex model

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

working with a complex model

jon_bondy
I'm working with a complex model, one that takes minutes to compute.  
I'm fiddling with a small part of the model: most of the model never
changes.

Is there any way to compute that invariant part once, so that the
re-calculations are less time consuming as I work on the rest of the model?

Thanks!

Jon

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: working with a complex model

nophead
If you put render() around it then it gets computed by CGAL and cached. So F5 is slow if it changes but fast if it doesn't. Don't forget to set the convexity parameter if you don an operations on it outside the render.

On 17 June 2015 at 14:18, jon <[hidden email]> wrote:
I'm working with a complex model, one that takes minutes to compute.  I'm fiddling with a small part of the model: most of the model never changes.

Is there any way to compute that invariant part once, so that the re-calculations are less time consuming as I work on the rest of the model?

Thanks!

Jon

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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: working with a complex model

jon_bondy
So THAT is what render() is for! The description says to use when "boolean operations become slow".  I had no idea...

As always, thank you for your help!

Jon

On 6/17/2015 9:27 AM, nop head wrote:
If you put render() around it then it gets computed by CGAL and cached. So F5 is slow if it changes but fast if it doesn't. Don't forget to set the convexity parameter if you don an operations on it outside the render.

On 17 June 2015 at 14:18, jon <[hidden email]> wrote:
I'm working with a complex model, one that takes minutes to compute.  I'm fiddling with a small part of the model: most of the model never changes.

Is there any way to compute that invariant part once, so that the re-calculations are less time consuming as I work on the rest of the model?

Thanks!

Jon

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



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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6030 / Virus Database: 4365/10034 - Release Date: 06/17/15



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: working with a complex model

jon_bondy
In reply to this post by nophead
The things that are computed in my render() are essentially global variables, that are used elsewhere in the script.  They then become unknown outside the scope of the render().

On 6/17/2015 9:27 AM, nop head wrote:
If you put render() around it then it gets computed by CGAL and cached. So F5 is slow if it changes but fast if it doesn't. Don't forget to set the convexity parameter if you don an operations on it outside the render.

On 17 June 2015 at 14:18, jon <[hidden email]> wrote:
I'm working with a complex model, one that takes minutes to compute.  I'm fiddling with a small part of the model: most of the model never changes.

Is there any way to compute that invariant part once, so that the re-calculations are less time consuming as I work on the rest of the model?

Thanks!

Jon

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



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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6030 / Virus Database: 4365/10034 - Release Date: 06/17/15



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: working with a complex model

nophead
You only need to put the geometry in the render(), not variable definitions that need to be global.

The way I make a large assembly like Mendel90 is to have a module for each printed part. When that is used in an assembly it is rendered. That means I can work on the part on its own without the render but the large assembly of parts is still fast because they are all cached. All my vitamins have renders in them one for each colour. So if I use a lot of fasteners there is only one cached version of each size of screw, for example.

Using render also gets rid of artefacts in OpenSCG caused by negative parts of one object interfering with another object.

On 17 June 2015 at 15:46, jon <[hidden email]> wrote:
The things that are computed in my render() are essentially global variables, that are used elsewhere in the script.  They then become unknown outside the scope of the render().

On 6/17/2015 9:27 AM, nop head wrote:
If you put render() around it then it gets computed by CGAL and cached. So F5 is slow if it changes but fast if it doesn't. Don't forget to set the convexity parameter if you don an operations on it outside the render.

On 17 June 2015 at 14:18, jon <[hidden email]> wrote:
I'm working with a complex model, one that takes minutes to compute.  I'm fiddling with a small part of the model: most of the model never changes.

Is there any way to compute that invariant part once, so that the re-calculations are less time consuming as I work on the rest of the model?

Thanks!

Jon

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



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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6030 / Virus Database: 4365/10034 - Release Date: 06/17/15



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



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: working with a complex model

MichaelAtOz
Administrator
In reply to this post by jon_bondy
You can also use the "!" modifier to just work on a small bit of code at a time, iif you don't need the rest of the model for visual reference.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: working with a complex model

tjhowse
Wow. There are a bunch of new (?) modifiers I didn't know about.
Thanks for that Michael.

On 18 June 2015 at 08:35, MichaelAtOz <[hidden email]> wrote:

> You can also use the "!"  modifier
> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters>  to
> just work on a small bit of code at a time, iif you don't need the rest of
> the model for visual reference.
>
>
>
> -----
> Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
> --
> View this message in context: http://forum.openscad.org/working-with-a-complex-model-tp12906p12911.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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