Skip to content

STLReader

Introduction

vtkSTLReader is a source object that reads ASCII or binary stereo lithography files (.stl files). The object automatically detects whether the file is ASCII or binary. .stl files are quite inefficient since they duplicate vertex definitions.

Methods

extend

Method used to decorate a given object (publicAPI+model) with vtkSTLReader characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesISTLReaderInitialValuesNo(default: {})

getBaseURL

getDataAccessHelper

getLocator

Get the point locator used for vertex merging.

getMerging

Get whether point merging is enabled.

getRemoveDuplicateVertices

Get tolerance when removeDuplicateVertices is set

getUrl

Get the url of the object to load.

loadData

Load the object data.

ArgumentTypeRequiredDescription
optionsISTLReaderOptionsNo

newInstance

Method used to create a new instance of vtkSTLReader

ArgumentTypeRequiredDescription
initialValuesISTLReaderInitialValuesNofor pre-setting some of its content

parse

Parse data.

ArgumentTypeRequiredDescription
contentString or ArrayBufferYesThe content to parse.

parseAsArrayBuffer

Parse data as ArrayBuffer.

ArgumentTypeRequiredDescription
contentArrayBufferYesThe content to parse.

parseAsText

Parse data as text.

ArgumentTypeRequiredDescription
contentStringYesThe content to parse.

requestData

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setDataAccessHelper

ArgumentTypeRequiredDescription
dataAccessHelperYes

setLocator

Set a point locator used for vertex merging.

setMerging

Enable/disable point merging.

setRemoveDuplicateVertices

Turn on/off automatic removeDuplicateVertices After reading the STL file, if tolerance is >= 0, then points with the same coordinates at 10 power tolerance are merged. For a smooth rendering, you might want to compute normals with vtkPolyDataNormals.

ArgumentTypeRequiredDescription
toleranceNumberYes

setUrl

Set the url of the object to load.

ArgumentTypeRequiredDescription
urlStringYesthe url of the object to load.
optionISTLReaderOptionsNoThe STL reader options.