Use dashed lines on Box3Helper?

box3helper when initialized has a lineBasicMaterial

after replacing the material with

box3helper .material = new THREE.LineDashedMaterial( {
	color: 0xffffff,
	linewidth: 1,
	scale: 1,
	dashSize: 3,
	gapSize: 1,
} );

the line is visible but there’s no dashes, and i can’t do computeLineDistances as it’s not a THREE.lineSegments object

is there any way to have dashed bounding box helper ?

the box3 values will be getting updated on translate or rotate action , so the helper needs to react to this change

Hi!
Box3Helper extends LineSegments.
But the problem is, that .computeLineDistances() can’t be called on an indexed geometry: three.js/LineSegments.js at c7d06c02e302ab9c20fe8b33eade4b61c6712654 · mrdoob/three.js · GitHub, and Box3Helper has exactly that type of geometry: three.js/Box3Helper.js at c7d06c02e302ab9c20fe8b33eade4b61c6712654 · mrdoob/three.js · GitHub

1 Like

can it be calculated somehow or its impossible to do on indexed geo ?

or does this approach sound good ?
every time i update the box3
i make or update a lineSegments objects with box3 min and max values to represent the bounds

This is the best I could think of, from the scratch: https://codepen.io/prisoner849/full/jOYyrzQ

3 Likes