discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Optional red highlight/debug

LM
Leonard Martin Struttmann
Sat, Jun 14, 2025 1:45 AM

I dimly remember this being asked before but I've not been able to find the
answer.

Is there a clever/less cumbersome way to optionally apply the debug prefix
"#"?  Similar to the following?

module myObject( debug=false ) {
xyz = [ 10, 20, 30 ];

if (debug) {
#cube( xyz );
}
else {
cube( xyz );
}
}

Thanks!  Len

I dimly remember this being asked before but I've not been able to find the answer. Is there a clever/less cumbersome way to optionally apply the debug prefix "#"? Similar to the following? module myObject( debug=false ) { xyz = [ 10, 20, 30 ]; if (debug) { #cube( xyz ); } else { cube( xyz ); } } Thanks! Len
TA
Todd Allen
Sat, Jun 14, 2025 3:46 AM

You could limit the cumbersome bit to a module such as:

module debug() {
if($debug)
#children();
else
children();
}
and then just use debug() instead of # when you want it easily
enabled/disabled by setting $debug.

On Fri, Jun 13, 2025 at 8:46 PM Leonard Martin Struttmann via Discuss <
discuss@lists.openscad.org> wrote:

I dimly remember this being asked before but I've not been able to find
the answer.

Is there a clever/less cumbersome way to optionally apply the debug prefix
"#"?  Similar to the following?

module myObject( debug=false ) {
xyz = [ 10, 20, 30 ];

if (debug) {
#cube( xyz );
}
else {
cube( xyz );
}
}

Thanks!  Len


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

You could limit the cumbersome bit to a module such as: module debug() { if($debug) #children(); else children(); } and then just use debug() instead of # when you want it easily enabled/disabled by setting $debug. On Fri, Jun 13, 2025 at 8:46 PM Leonard Martin Struttmann via Discuss < discuss@lists.openscad.org> wrote: > I dimly remember this being asked before but I've not been able to find > the answer. > > Is there a clever/less cumbersome way to optionally apply the debug prefix > "#"? Similar to the following? > > module myObject( debug=false ) { > xyz = [ 10, 20, 30 ]; > > if (debug) { > #cube( xyz ); > } > else { > cube( xyz ); > } > } > > Thanks! Len > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Sat, Jun 14, 2025 3:56 AM

In BOSL2 you can do

highlight(debug) children();

On Fri, Jun 13, 2025 at 11:46 PM Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

You could limit the cumbersome bit to a module such as:

module debug() {
if($debug)
#children();
else
children();
}
and then just use debug() instead of # when you want it easily
enabled/disabled by setting $debug.

On Fri, Jun 13, 2025 at 8:46 PM Leonard Martin Struttmann via Discuss <
discuss@lists.openscad.org> wrote:

I dimly remember this being asked before but I've not been able to find
the answer.

Is there a clever/less cumbersome way to optionally apply the debug
prefix "#"?  Similar to the following?

module myObject( debug=false ) {
xyz = [ 10, 20, 30 ];

if (debug) {
#cube( xyz );
}
else {
cube( xyz );
}
}

Thanks!  Len


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

In BOSL2 you can do highlight(debug) children(); On Fri, Jun 13, 2025 at 11:46 PM Todd Allen via Discuss < discuss@lists.openscad.org> wrote: > You could limit the cumbersome bit to a module such as: > > module debug() { > if($debug) > #children(); > else > children(); > } > and then just use debug() instead of # when you want it easily > enabled/disabled by setting $debug. > > On Fri, Jun 13, 2025 at 8:46 PM Leonard Martin Struttmann via Discuss < > discuss@lists.openscad.org> wrote: > >> I dimly remember this being asked before but I've not been able to find >> the answer. >> >> Is there a clever/less cumbersome way to optionally apply the debug >> prefix "#"? Similar to the following? >> >> module myObject( debug=false ) { >> xyz = [ 10, 20, 30 ]; >> >> if (debug) { >> #cube( xyz ); >> } >> else { >> cube( xyz ); >> } >> } >> >> Thanks! Len >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >