public class Slicer extends Complex3dModel
Slice a model into pieces; the result is one of the slices. It is very useful if the model is too big to be printed in one piece.
The result is based on the Abstract3dModel.getBoundaries()
, so if that cannot be calculated for
any reason, the slice will fail. However, the result of a slice can be sliced again, so you can
slice a model first in the X direction and then in the Y.
Constructor and Description |
---|
Slicer(Abstract3dModel model,
Direction direction,
double lowRate,
double highRate)
Slices the given model in the given direction.
|
Slicer(Abstract3dModel model,
Direction direction,
int piece,
int index)
Slices the given model in the given direction.
|
Modifier and Type | Method and Description |
---|---|
protected List<Abstract3dModel> |
getChildrenModels() |
protected Boundaries3d |
getModelBoundaries() |
protected Abstract3dModel |
innerCloneModel() |
protected Abstract3dModel |
innerSubModel(IScadGenerationContext context) |
protected SCAD |
innerToScad(IColorGenerationContext context)
Generates the OpenSCAD representation of the model without.
|
protected CSG |
toInnerCSG(FacetGenerationContext context) |
isPrimitive
addModel, addModelTo, align, align, align, align, align, annotate, background, cloneModel, debug, findAnnotatedModel, getBoundaries, getTag, isBackground, isDebug, isMoved, isRotated, move, moves, moves, moves, moves, rotate, rotates, rotates, round, subModel, subtractModel, toCSG, toCSG, toScad, withTag
public Slicer(Abstract3dModel model, Direction direction, int piece, int index)
Slices the given model in the given direction. There will be piece number of equals sized slice, and this object will represent the index of them.
Throws IllegalValueException if the model is null; or the direction is null; or the index is negative; or the piece is negative; or the index is bigger or equals to piece.
model
- the model to be sliceddirection
- the direction the slice should go - it can be X, Y or Zpiece
- the number of piecesindex
- the index of this piece - it is start from 0 to piece-1public Slicer(Abstract3dModel model, Direction direction, double lowRate, double highRate)
Slices the given model in the given direction. It will cut off lowRate portion from one side, and highRate portion from the other side. Both rates are relative to the size of the given model.
Throws IllegalValueException if the model is null; or the direction is null; or the rates are negative; or the sum of the two rates are bigger than one.
model
- the model to be sliceddirection
- the direction the slice should go - it can be X, Y or ZlowRate
- the rate of the portion which has to be cut off from the lower sidehighRate
- the rate of the portion which has to be cut off from the higher sideprotected SCAD innerToScad(IColorGenerationContext context)
Abstract3dModel
innerToScad
in class Abstract3dModel
protected Boundaries3d getModelBoundaries()
getModelBoundaries
in class Abstract3dModel
protected Abstract3dModel innerCloneModel()
innerCloneModel
in class Abstract3dModel
protected CSG toInnerCSG(FacetGenerationContext context)
toInnerCSG
in class Abstract3dModel
protected Abstract3dModel innerSubModel(IScadGenerationContext context)
innerSubModel
in class Abstract3dModel
protected List<Abstract3dModel> getChildrenModels()
getChildrenModels
in class Abstract3dModel
Copyright © 2014–2020, Printing in 3D. All rights reserved.