--- layout: posts title: Api - ICascadeModel Interface ---
Use the $original as the $result.
The current final value of the cascade.
Add a Caption object to a model.
Text to add.
Optional Point on left side middle of text.
Optional Point on right side middle of text.
this cascade container, this.$result will be The original model (for cascading).
Add a model as a child. This is basically equivalent to:
parentModel.models[childModelId] = childModel;
with additional checks to make it safe for cascading.
The model to add.
The id of the child model.
(default false) Optional flag to overwrite any model referenced by childModelId. Default is false, which will create an id similar to childModelId.
this cascade container, this.$result will be The original model (for cascading).
Add a path as a child. This is basically equivalent to:
parentModel.paths[childPathId] = childPath;
with additional checks to make it safe for cascading.
The path to add.
The id of the path.
(default false) Optional flag to overwrite any path referenced by pathId. Default is false, which will create an id similar to pathId.
this cascade container, this.$result will be The original model (for cascading).
Add a model as a child of another model. This is basically equivalent to:
parentModel.models[childModelId] = childModel;
with additional checks to make it safe for cascading.
The model to add to.
The id of the child model.
(default false) Optional flag to overwrite any model referenced by childModelId. Default is false, which will create an id similar to childModelId.
this cascade container, this.$result will be The original model (for cascading).
DEPRECATED Break a model's paths everywhere they intersect with another path.
Optional model containing paths to look for intersection, or else the modelToBreak will be used.
this cascade container, this.$result will be The original model (for cascading).
Center a model at [0, 0].
(default true) Boolean to center on the x axis. Default is true.
(default true) Boolean to center on the y axis. Default is true.
this cascade container, this.$result will be The original model (for cascading).
Clone a model. Alias of makerjs.cloneObject(modelToClone)
this cascade container, this.$result will be A clone of the model you passed.
Combine 2 models. Each model will be modified accordingly.
Second model to combine.
(default false) Flag to include paths from modelA which are inside of modelB.
(default true) Flag to include paths from modelA which are outside of modelB.
(default false) Flag to include paths from modelB which are inside of modelA.
(default true) Flag to include paths from modelB which are outside of modelA.
Optional ICombineOptions object.
this cascade container, this.$result will be A new model containing both of the input models as "a" and "b".
Combine 2 models, resulting in a intersection. Each model will be modified accordingly.
Second model to combine.
this cascade container, this.$result will be A new model containing both of the input models as "a" and "b".
Combine 2 models, resulting in a subtraction of B from A. Each model will be modified accordingly.
Second model to combine.
this cascade container, this.$result will be A new model containing both of the input models as "a" and "b".
Combine 2 models, resulting in a union. Each model will be modified accordingly.
Second model to combine.
this cascade container, this.$result will be A new model containing both of the input models as "a" and "b".
Convert a model to match a different unit system.
The unit system.
this cascade container, this.$result will be The scaled model (for cascading).
Create a distorted copy of a model - scale x and y individually.
The amount of x scaling.
The amount of y scaling.
(default false) Optional boolean to scale the origin point. Typically false for the root model.
Optional accuracy of Bezier curves.
this cascade container, this.$result will be New model (for cascading).
Expand all paths in a model, then combine the resulting expansions.
Distance to expand.
(default 0) Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints.
(default {}) Optional object containing combine options.
this cascade container, this.$result will be Model which surrounds the paths of the original model.
Set the layer of a model. This is equivalent to:
modelContext.layer = layer;
The layer name.
this cascade container, this.$result will be The original model (for cascading).
Create a clone of a model, mirrored on either or both x and y axes.
Boolean to mirror on the x axis.
Boolean to mirror on the y axis.
this cascade container, this.$result will be Mirrored model.
Move a model to an absolute point. Note that this is also accomplished by directly setting the origin property. This function exists for cascading.
The new position of the model.
this cascade container, this.$result will be The original model (for cascading).
Move a model's origin by a relative amount.
The x & y adjustments as a point object.
this cascade container, this.$result will be The original model (for cascading).
Moves all of a model's children (models and paths, recursively) in reference to a single common origin. Useful when points between children need to connect to each other.
Optional offset reference point.
this cascade container, this.$result will be The original model (for cascading).
Outline a model by a specified distance. Useful for accommodating for kerf.
Distance to outline.
(default 0) Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints.
(default false) Optional boolean to draw lines inside the model instead of outside.
(default {}) Options to send to combine() function.
this cascade container, this.$result will be Model which surrounds the paths outside of the original model.
Prefix the ids of paths in a model.
The prefix to prepend on paths ids.
this cascade container, this.$result will be The original model (for cascading).
Remove paths from a model which have endpoints that do not connect to other paths.
Optional max distance to consider two points as the same.
Optional callback function (which should return a boolean) to decide if a dead end path should be kept instead.
Optional callback function which will log discarded paths and the reason they were discarded.
this cascade container, this.$result will be The input model (for cascading).
Rotate a model.
The amount of rotation, in degrees.
(default [0, 0]) The center point of rotation.
this cascade container, this.$result will be The original model (for cascading).
Scale a model.
The amount of scaling.
(default false) Optional boolean to scale the origin point. Typically false for the root model.
this cascade container, this.$result will be The original model (for cascading).
Simplify a model's paths by reducing redundancy: combine multiple overlapping paths into a single path. The model must be originated.
Optional options object.
this cascade container, this.$result will be The simplified model (for cascading).
Recursively walk through all child models and paths for a given model.
Object containing callbacks.
this cascade container, this.$result will be The original model (for cascading).
Move a model so its bounding box begins at [0, 0].
(default true) Boolean to zero on the x axis. Default is true.
(default true) Boolean to zero on the y axis. Default is true.
this cascade container, this.$result will be The original model (for cascading).
Generated using TypeDoc
The initial context object of the cascade.