Skip to content
Marvin Greenberg edited this page May 15, 2019 · 9 revisions

FaceSVG SVG output from Sketchup

The goal of this project is to provide a way to generate SVG output from within the Sketchup 3d modeling tool. This is motivated by the arrival of a new product, the Shaper Origin, which provides for a CNC-like experience using a handheld router. See https://shapertools.com. But some of these capabilities are useful in other contexts, such as laser cutting.

Shaper support has provided a basic plugin for SVG output from a different tool, Autodesk Fusion 360. Many woodworkers use Sketchup (SU), for a variety of reasons, and have other tools and work flows based on it. I wanted a plugin that allowed me to make accurate 3d models for woodworking, and be able to generate the required SVG cut profiles directly from within the tool. SU supports lines, and circular and elliptical arcs, with complete accuracy. If you are using the freehand tool or other plugins that generate curves (other than circular or elliptical arcs) in SU, these will be generated within SU as a series of line segments. There is no metadata built in to SU to accurately represent these curves in SVG - they will simply be line segments.

Latest Release

  • Minor fixes for certain kinds of pocket cuts, and for hexagonal and other polygonal shapes.
  • Support for pocket cuts

    Given a face with inset faces (pockets) the plugin will generate the appropriate inset areas in SVG in gray fill as required by the Shaper Origin. Attributes will be attached to the SVG with the calculated depth.

  • Identification of related faces

    When a pocket cut, such as a slot for a shelf, completely separates a face into disjoint faces, outputing these as disjoint faces is incorrect. Logic is added to identify the connected co-planar faces and emit them, as well as the slots and pockets as a group.

  • Generated profiles are generated as faces instead of simple closed paths.

    This allows small edits to be more easily made to the generated profiles. In some cases, a face might not represent the required cutting path because of the nature of fabrication. Rather than artificially changing the 3d model, or using an external tool to modify the SVG, these small changes could be made on the face profiles.

  • A settings panel

    • Layout width
    • Layout Offset
    • Cutter depth
    • Pocket Depth (max)

    These settings are mostly minor tweaks to how the elements are layed out and the SVG is generated. Setting Pocket Depth (max) to 0.0 can be used to disable the generation of pocket profiles, if desired.

Other possibilities, future development

  • Support for guide lines

    Shaper Origin allows for blue guide lines to be added to the SVG, to help register the tool or provide information about the cut. Notionally simple, it is unclear what sorts of guide information would be useful.

  • Guide text annotations

    Apparently the Shaper Origin does not support any attributes to specify depth of cut - for example for pocket cuts. Add blue test annotations on pocket faces to indicate the desired depth.

  • Automatic Dogbones/Corner relief for mortise slots

    After a little research, the basic math involved seems pretty simple. This should be pretty straightforward to implement the various options as described in the ShaperTools video Dogbones.

  • Automatic inset

    In certain videos, it is recommended that some operations be done at slightly reduced (or increased) dimensions, and then the Origin allows for small increments to be added. So an option could be provided for a hole, modeled as 20mm, to be generated as 19mm, allowing stepping up by 1/4mm increments, testing fit in between. Interestingly, this might be a use-case for a blue guide line.

  • Curve fit to get accurate quadratic or cubic splines

    Knowing that a collection of segments is a curve, with other hints, it should be possible to fit an accurate representation that could use then be used to emit smooth, accurate representation into SVG. There is a plugin I came across that allows creation of "B-splines" within SU. These are actually simply collections of line segments, as discussed earlier. This could be modified to maintain metadata about the parameters creating the curve, to allow the accurate representation to be emitted as SVG without any fitting. But there would be complicated issues to get this to work dependably, as a generated curve could be copied, intersected, transformed. Maintaining the metadata would be complicated.

  • Direct upload to MyHub

    It should be relatively straightforward to upload generated SVG directly to Shaper MyHub. May not be that worth it since people would have to enter credentials into tool.
    Simpler but still useful would be just an option to open an embedded page to MyHub just to allow manual uploads.

  • SVG import into Sketchup Really going far afield now, but it might be useful to be able to use Sketchup to take an existing Shaper file from somewhere else and turn it into faces to be able to make a 3d model.

  • Open paths - line or path etching This is unclear. SU does not provide any way to link or glue an open line segment to a face. The equivalent could easily be supported by using a thin pocket cut - rather than a line draw a thin inset formed by parallel lines or curves.

  • Text The "3d" text SU provides is not very attractive, IMO, and associating it with faces may not be possible.

Older Releases

This is a small fix to the v1.0.0 release. The earlier release is available directly from the SU Extension Warehouse here. . This fixes an inability to generate curves generated with the freehand tool. As mentioned above, these are not actually smooth curves in SU, and as a result can only be generated as a series of line segments. The number of line segments SU uses to approximate arcs can be controlled, from somewhere in the settings. But this may still be insufficient for certain applications.

Limitations
  • No editing generated profiles

    When one or more faces are selected, the boundary inner and outer edges are selected and recreated in the z=0 plane, as closed paths. All the boundaries associated with a particular face are collected in a SU group, and each face group is collected in a common profile group. This shows the resulting profiles that will be emitted. But changing the profiles to customize the SVG output is not possible, and in general editing the segments within SU is not possible.

  • No support for pocket cuts

    Shaper origin has the concept of cutting a pocket or recess into the surface. But a recess, such as a dado slot other inset would simply be a separate face, and its outline would not be grouped with the other face boundaries.