Overview
With the Jenner firmware update, the Shaper Origin now supports the concept of depth encoding in design files (SVGs). SVG files are essentially XML with plaintext tags and attributes. Shaper adds their own namespace and defines an attribute called cutDepth. Shaper Studio will embed these attributes for you, but for other design software there is no simple way to add these.
Most vector design packages allow the user to name the shapes (aka paths, curves). Most also allow multiple shapes to be grouped into layers, which themselves can be named. When the SVG file is generated, these names are stored in the id attribute of the various shapes and groups. This tool, SvgDepth, will parse these names and if it finds a depth description it will add the corresponding cutDepth attribute. In this way, you can add persistent depth information to your designs simply by naming the shapes and layers appropriately. This tool provides a fast and simple post-processing step to add the necessary attributes for Origin to understand your desired depths.
Features
- In memory processing, the tool never copies or stores your design anywhere
- Works with metric or standard units (in, m, cm, mm, um)
- Applies depths hierarchically. A layer with a name containing depth information will apply that depth to all objects in the layer (unless overridden)
Example
This screenshot is from Affinity Designer, but a similar situation should be found in most vector design programs.
Here we have a layer containing two holes. I have added depth information to the layer name which will cause it to apply to all objects contained in the layer. However, an individual object can override the parent's defined depth. In this case, RightHole does not specify depth info and therefore it inherits 1.5 inches from the layer. LeftHole does define depth info and therefore it overrides and sets the depth to 1.75 inches. The white rectangle is not part of a layer but is still able to define a depth of 30mm. Note that the inheritance can go to arbitrary depths. In other words, you can have a layer which contains layers, which contains layers, and the depth info of the higher levels will apply all the way down.
Syntax
The regular expression used (.NET style) is as follows:
depth(\d*(.\d+)?)(in|um|mm|cm|m)
This allows for the depth expression to be found anywhere in the name. Note that um (microns, or micrometers) are not a native Origin unit and are thus converted to the equivalent millimeters value.
Discussion
For any questions or requests please join the discussion on the Shaper forums