discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Is there a way to determine if doing a render as opposed to a preview?

A
adrian
Sun, Feb 26, 2017 8:14 PM

nophead wrote

adrian wrote

No, wrong direction.

You seem to want a module higher in the tree to affect a module lower in
the tree. That is the right direction for dynamic scope variables. They
are visible to all the lower modules in the tree, i.e. nearer and
including the leaves.

So instead of using color in foo you use a module that gets information
from higher in tree to set the colour.

Oh, you're right, but you can't modify based on the previous value, you can
only override th value.  So, given the example I suggested, I can set, but
not *increase *or decrease.  Or perhaps I could but not in a scalable way.

--
View this message in context: http://forum.openscad.org/Is-there-a-way-to-determine-if-doing-a-render-as-opposed-to-a-preview-tp20588p20604.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

nophead wrote > > adrian wrote >> No, wrong direction. > You seem to want a module higher in the tree to affect a module lower in > the tree. That is the right direction for dynamic scope variables. They > are visible to all the lower modules in the tree, i.e. nearer and > including the leaves. > > So instead of using color in foo you use a module that gets information > from higher in tree to set the colour. Oh, you're right, but you can't modify based on the previous value, you can only override th value. So, given the example I suggested, I can *set*, but not *increase *or *decrease*. Or perhaps I could but not in a scalable way. -- View this message in context: http://forum.openscad.org/Is-there-a-way-to-determine-if-doing-a-render-as-opposed-to-a-preview-tp20588p20604.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Sun, Feb 26, 2017 8:15 PM

Thanks Greg,

Forgot about that operator.  Still, I need the context, so not exactly what
I'm looking for.

--
View this message in context: http://forum.openscad.org/Is-there-a-way-to-determine-if-doing-a-render-as-opposed-to-a-preview-tp20588p20605.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thanks Greg, Forgot about that operator. Still, I need the context, so not exactly what I'm looking for. -- View this message in context: http://forum.openscad.org/Is-there-a-way-to-determine-if-doing-a-render-as-opposed-to-a-preview-tp20588p20605.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Sun, Feb 26, 2017 8:22 PM

I don't see why you can't do exactly what you want as you can pass as much
down the tree as you want, but without coding it myself I can't be sure.

On 26 February 2017 at 20:15, adrian adrianh.bsc@gmail.com wrote:

Thanks Greg,

Forgot about that operator.  Still, I need the context, so not exactly what
I'm looking for.

--
View this message in context: http://forum.openscad.org/Is-
there-a-way-to-determine-if-doing-a-render-as-opposed-to-
a-preview-tp20588p20605.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I don't see why you can't do exactly what you want as you can pass as much down the tree as you want, but without coding it myself I can't be sure. On 26 February 2017 at 20:15, adrian <adrianh.bsc@gmail.com> wrote: > Thanks Greg, > > Forgot about that operator. Still, I need the context, so not exactly what > I'm looking for. > > > > -- > View this message in context: http://forum.openscad.org/Is- > there-a-way-to-determine-if-doing-a-render-as-opposed-to- > a-preview-tp20588p20605.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
A
adrian
Sun, Feb 26, 2017 8:39 PM

Hi nophead,
Try doing it with the example that I posted above:
module foo(){  color([1,0,0,.5])    sphere(r=10);  translate([10,0,0])
color([0,1,0,.25])      sphere(r=10);}

--
View this message in context: http://forum.openscad.org/Is-there-a-way-to-determine-if-doing-a-render-as-opposed-to-a-preview-tp20588p20607.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi nophead, Try doing it with the example that I posted above: module foo(){ color([1,0,0,.5]) sphere(r=10); translate([10,0,0]) color([0,1,0,.25]) sphere(r=10);} -- View this message in context: http://forum.openscad.org/Is-there-a-way-to-determine-if-doing-a-render-as-opposed-to-a-preview-tp20588p20607.html Sent from the OpenSCAD mailing list archive at Nabble.com.