Skip to content

.NET API

RasterToVectorApi

Scriptable version of the ArtisanRaster2Vector tool: traces a bitmap image into Rhino curves with the embedded Potrace engine, without the panel / preview. Same parameters, same defaults, same output placement as the tool’s Insert button (curves on the primary user layer, laid on the world XY plane starting at the origin).

from ArtisanPlugin.Scripting import RasterToVectorApi

See also the Python package, ra.raster_to_vector.

Methods

Method
CreateVectorizes the image at path and adds the traced curves to the document.

Create

IReadOnlyList<Guid> RasterToVectorApi.Create(
    string path,
    double threshold = 0.51,
    int ignoreArea = 2,
    double cornerThreshold = 1,
    double tolerance = 0.2,
    double targetWidth = 0)

Vectorizes the image at path and adds the traced curves to the document. Returns the ids of the added curves. threshold 0..1 black/white cut (default 0.51). Lower keeps more dark detail, higher more of the image. ignoreArea speckles up to this many pixels are dropped (default 2) cornerThreshold Potrace alphamax: 0 = sharp polygons, higher = rounder (default 1.0) tolerance curve optimization tolerance (default 0.2) targetWidth if > 0, the result is uniformly scaled so its total width is exactly this many model units (e.g. fit a motif to 12 mm). 0 = the tool’s native sizing (1 unit per 50 image pixels).

ParameterTypeDefault
pathstringrequired
thresholddouble0.51
ignoreAreaint2
cornerThresholddouble1
tolerancedouble0.2
targetWidthdouble0

Returns IReadOnlyList<Guid>.