@@ -72,6 +72,7 @@ export type GCodePreviewOptions = {
7272 travelColor ?: ColorRepresentation ;
7373 toolColors ?: Record < number , ColorRepresentation > ;
7474 disableGradient ?: boolean ;
75+ extrusionWidth ?: number ;
7576} ;
7677
7778const target = {
@@ -93,6 +94,7 @@ export class WebGLPreview {
9394 renderExtrusion = true ;
9495 renderTravel = false ;
9596 renderTubes = false ;
97+ extrusionWidth = 0.6 ;
9698 lineWidth ?: number ;
9799 startLayer ?: number ;
98100 endLayer ?: number ;
@@ -140,6 +142,7 @@ export class WebGLPreview {
140142 this . renderTravel = opts . renderTravel ?? this . renderTravel ;
141143 this . nonTravelmoves = opts . nonTravelMoves ?? this . nonTravelmoves ;
142144 this . renderTubes = opts . renderTubes ?? this . renderTubes ;
145+ this . extrusionWidth = opts . extrusionWidth ?? this . extrusionWidth ;
143146
144147 if ( opts . extrusionColor !== undefined ) {
145148 this . extrusionColor = opts . extrusionColor ;
@@ -626,7 +629,7 @@ export class WebGLPreview {
626629 const material = new MeshLambertMaterial ( { color : color } ) ;
627630 this . disposables . push ( material ) ;
628631 const segments = Math . ceil ( curve . getLength ( ) * 2 ) ;
629- const geometry = new TubeGeometry ( curve , segments , 0.3 , 4 , false ) ;
632+ const geometry = new TubeGeometry ( curve , segments , this . extrusionWidth / 2 , 4 , false ) ;
630633 this . disposables . push ( geometry ) ;
631634 const lineSegments = new Mesh ( geometry , material ) ;
632635
0 commit comments