MakerBot Print is our newest print-prepration software, which supports native CAD files and STL assemblies,
allows you to interact with all your printers via the Cloud, and many other exciting new features.

Download Now

A little help with OpenSCAD to Customizer translation?

Please Login to Comment

Hey all,

Thought I'd give this a try and I've mostly got a working model, but can't quite get one variable to transfer over to OpenSCAD.

Here's the Thing: https://www.thingiverse.com/thing:2928206

Everything appears to work except my text variables, hatchText and bottomText.

I imagine it's something to do with my tabbing or semicolons under the difference function, but it's a little hard to troubleshoot without knowing what's happening behind the scenes of Customizer (is there a simulator plugin I'm missing for OpenSCAD?).

EDIT: Changing the values in OpenSCAD works fine! It's just when I upload it to Customizer that it breaks.

Cable Label
by shed1

You can force OpenSCAD to treat the variable as a string using the STR function:

Change the text input field names here:

/* [Text] */
hatchTextIn = "McK ICT"; // Hatch text
bottomTextIn = "3";

This will allow numeric-only labels to print properly. You still have default font size and centering issues, but this will solve the non-display of numeric-only text.
and later, in the Hidden Section, build the string you want to show:

/* [Hidden] */ 
hatchText = str(hatchTextIn);
bottomText = str(bottomTextIn); // Bottom text

This will allow the numeric-only labels to print.

You still have problems with the default font size (editable - I'd make it default to "2" like the hatch text) and centering issues (which I didn't look into) for the bottom label.

Looks like that fixed the issue with the text as a string, but now it won't display as a parameter.

Edit: Fixed that issue. Now my hatchText is broken! Neither defining it as a string in a second variable or defining it in quotes as the hatchText variable seems to work. It seems to display the default "McK ICT", but won't change based on the text box.

Awesome, thanks so much! I'll give that a try.

It might be a bug with Customizer misinterpreting the numbers. If I add a space on either side I can get it to display correctly, so that may be a viable workaround.

Something weird also seems to be going on with text alignment, and I can only guess that's also an issue with Customizer since it seems fine in OpenSCAD.

I haven't had an issue with text alignment, at least with what I could see in Customizer.

I've fixed the bottom text issue thanks to @Hank-Cowdog's suggestions, but as a result broken the hatch text.

Thanks for the reply!

I downloaded and reuploaded the code. My version seems to work in Customizer, though the only thing I actually changed was the contents of hatchTextIn. I'm guessing a stray non-printable character in your code is confusing Customizer.

I suggest you try this one, and if it works for you, too, then view source/copy/paste and update your version.


Once yours is working, let me know and I'll delete my copy.

Helping to fix the Cable Labeler

Ahh that's awesome, thanks so much! That does work.

It's super strange behaviour though. I uploaded the model with the contents of just "ICT" and it worked, it was able to be changed and printed for that variable, but as soon as I place my "McK" back in front of it, the model breaks permanently, even after re-opening.

It would be great to know what's going on behind there. Do you know who I can ping or contact for a bug report?

Still not quite sure what's happening here.

I changed my text to "AAABBB" as in yours and I get the same issue, so I'm assuming it's not related to the text string itself.

I think there are a couple of things going on:
The Text function doesn't seem to like just numbers as the text.
The default size of the bottom text is too big, so it extends off of the part.

Spot on, thank you!