Ruler in Carbide create

I just used it to create a ‘template’ .c2d file.
You could always create a few different stock-size templates if you needed to. You just have to remember to start with it. :wink:

blank_template_8x8.c2d (1.6 MB)

1 Like

We’ll have to draw one up in Inkscape or some other program as an SVG which can then be imported.

I just looked at Will’s ruler.c2d as an example, and it appears that C2D files are just JSON-looking data with a handful of lists of items (“CIRCLE_OBJECTS”, “CURVE_OBJECTS”, “RECT_OBJECTS”, “TEXT_OBJECTS”, etc.) plus a “DOCUMENT_VALUES” section. The IDs in the data look like UUIDs.

All that being the case, it looks like it could likely be all but trivial to merge the objects from one C2D file into another. I’ll see if I can whip up something so we can try it out and see if it is indeed just that easy, as it sounds like something that would be quite nice to have.

(It is the middle of the night and I’m replying from bed, so I reserve the right to be wrong, of course, but hey, if you can’t evaluate code in the dark in the middle of the night, what can you do? :sweat_smile: :grinning:)

[Editor’s Note: …an hour passes…]

Well, thanks a lot. :joy:

I couldn’t fall asleep with such an interesting and likely simple question on my mind, so I figured why not get up and give it a whirl. Long story short, it was that simple, but a merged file is inconvenient if everything in the source files wasn’t grouped. Selecting in Carbide Create has always been rather terrible, after all. So, the obvious answer would be to group everything in each file before merging.

Turns out, that’s also trivial, as you just have to append a new UUID to the “group_id” list for each object. (Grouping grouped items into supergroups and so on just adds the new group ID to the end of each individual item, which makes life easy.) So, a few lines of basically trivial python later, and I’ve got a completely functional C2D merging utility. It takes everything – the circle, curve, rect, regular polygon, text, and toolpath objects – from one file, and dumps them into the second (with everything coming from each file grouped together). The document properties of the second are untouched.

I’ll throw a bit of polish on the python so it’s all right and proper and takes command line parameters, and I’ll see if I can whip something up for the Windows users who aren’t comfy with python and the glories of command lines, but yeah, merging C2D files appears to indeed be utterly trivial.

And with that, I can now return to my regularly scheduled sleep state. :sleeping:

4 Likes

That’s pretty cool. :+1:

It’s hearing things like this that makes me wish they would create a set of API’s that would allow the community to integrate third party plugins or add-on’s for CC.

I’ve always been amazed at some of the “modding” that come from a community of passionate users. :smiley:

Yep that’s what I’ve been saying too. This way you can have a much better/full featured product to offer with minimal internal resources.

We do have a list at: https://wiki.shapeoko.com/index.php/Carbide_Create#Resources

(and apparently merging was already done once)

I’d like to include this sort of thing in my nascent Kickstarter: https://www.kickstarter.com/projects/designinto3d/917478342/preview?ref=pbuild_dashboard#project-preview (link requires one be logged into a Kickstarter account I believe)

Looking at that, it’s basically the same code as my middle-of-the-night draft, except it doesn’t group the items from each file like I do (which is really a necessary feature if you’re merging anything but two extremely basic files). I figure I should also make my real version a bit more flexible, as an N-to-1 merge has use cases. I’m also whipping one up natively for Windows GUI in Visual Studio so that people who don’t have a python environment or the desire to become cool can still merge two files. :stuck_out_tongue_winking_eye:

(It’s rather fun to jump back into a completely different environment to see how much more work it is to do a something that is so trivial in your normal environment.)

1 Like

Will, even after logging into KS, this link just takes me to the KS homepage.
I even tried searching for designinto3d, and notning came up

Here, Disqus seems to have re-written my link:

https://www.kickstarter.com/projects/designinto3d/917478342?ref=646688&token=075fd47d

May I present a very small Windows utility that I whipped together and have released to the public domain. I’ve run it through its paces in as many ways as I can think of, and now it’s all yours to do with what you may. It’s a tiny little program with just three buttons, but just to have it all fully documented, here you go.


MergeC2D

MergeC2D_Dialog

Instructions

  • Run MergeC2D.exe
  • Click the “Load File” button and load your first C2D.
    • The merged file will use all the “Job Setup” settings from this main file.
  • Click the “Load File” button to load your next file.
    • You can merge as many files as you’d like.
    • The objects and toolpaths from each will be added to the merged file.
    • Note: You can merge the same file multiple times, even.
  • Click the “Save Merged File” button to save the merged file.
    • After you save a file, you can immediately click “Load File” to start your next set.
  • If you want to clear everything without saving, click the “Clear” button.

Usage Notes

  • The locations of the objects in each file are preserved.
  • The complete set of objects from each file are automatically grouped before merging.
  • Merging files with different units, zeroes, or stock sizes is no problem. The settings in the main file, i.e. the first you load, will be used.

Copy it, share it, bundle it with your own Windows software, sell it on eBay*, whatever. I’ve released it to the public domain, so it’s officially anyone’s to do with what they want.

MergeC2D.zip (20.3 KB) – check for new versions on github.

*Don’t actually try to sell it on eBay. You’re allowed, but that wouldn’t be nice.

5 Likes

for petes sake Nathaniel, it’s been a full 12 hours since inception.
what took you so long!!! :stuck_out_tongue_winking_eye:

Nice! I’ll have to try that! Thanks for putting in all the work. That’s awesome!

I don’t have a use for this, but wanted to say thanks for spending your time on something for the community.

1 Like

Well, after an initial workout with MergeC2D, it’s solid. Working flawlessly so far. :+1::+1:

The only minor “issue” I’ve found is that the window being a small static size without scrollbars hides the filenames if your files are buried in a deep directory structure.

Any chance you could unlock the window resizing functionality?

By your command. :smile:

(I already figured I would, but allowing the form to resize means I have to move and resize all the controls around. Figured I’d start by getting it out there the easy way, then come back for the inevitable resizing.)

1 Like

Good. Because there’s no way I’m going to be able to resell this on ebay if I can’t resize the window!
:laughing:

Seriously though, it’s not a big deal. It’s not like I’m going to forget the filenames I just selected (at least I hope not). Was just more of a ‘nice to have’.
thanks again!

MergeC2D.zip (20.3 KB) – check for new versions on github.

That oughta do 'er, eh? :rofl:

2 Likes

Okay, and if anyone wants it in python, here you go. It’s basically functionally equivalent (merge any number of .c2d files, with the objects from each nicely grouped), but writing it in wonderful python leads to much less obtuse source code. I figured a tiny Windows GUI utility was worth the effort, but I for one would much rather go back to my terminal. :grin:

I threw it onto github, and I’m attaching it zipped here as well.

MergeC2D.py.zip (1.0 KB) – old version. Updated on github.

2 Likes

I was just playing around with a file (thinking about making something to render rulers at will, now that we can combine them in with our C2D files), and it turns out that you absolutely can set a 1/16" (exactly 1.5875 mm, by definition) grid size, just not through the Carbide Create UI. This one’s probably simple enough for anyone to do:

Custom Grid Size in Carbide Create

  1. Open any .c2d file in a text editor.
    • I highly recommend something like Notepad++, as it’s free and it handles large files like a dream, unlike the native Notepad in Windows, which… does not.
  2. Search for "grid_spacing" (with the double-quotes).
  3. You will find one and only one item that looks like "grid_spacing": number, (where number is whatever your grid spacing was set to in Carbide Create).
  4. Change number to whatever you want, in millimeters.
    • Carbide Create .c2d files store all data in metric, as is only right. :wink:
    • One inch is exactly 25.4 millimeters, by definition.
  5. Save the .c2d file with your new grid size.
  6. Open the .c2d file in Carbide Create, and as long as you don’t change your grid size, it will use the one from the file.

And for your convenience, here’s a ready-made empty 16ths.c2d file with a grid in 1/16", precisely. You can, of course, use it as a merge basis if you go back and adjust the Job Setup details except the grid. (I was chatting with someone and he asked about 1/32" spacing, as that’s what he uses to center lines when designing on his olde CarveWright machine. Yep, looks like that works, too, so why not attach it just for fun.)

16ths.c2d (814 Bytes)
32ths.c2d (815 Bytes)

2 Likes

I’ve found my new carbide create best friend! :smiley:

Awesome info. Thanks again Nathaniel.