-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Labels
Description
Description
When passing a simple 2 point line shape to SVGLoader pointToStroke, when linecap is set to square, the resulting geometry is incorrect.
It works correctly when linecap is either butt or round.
Reproduction steps
create a 2 point line shape
getStrokeStyle passing linecap set to 'square'
pass resulting shape and stroke style to pointsToStroke
Code
const shape = new Shape();
shape.moveTo(-12, 0);
shape.lineTo(12, 0);
const style = SVGLoader.getStrokeStyle(
2,
"white",
undefined,
"square",
undefined
);
const geometry = SVGLoader.pointsToStroke(shape.getPoints(), style);
const material = new MeshBasicMaterial({ side: DoubleSide });
const rect = new Mesh(geometry, material);
scene.add(rect);Live example
https://codesandbox.io/s/three-stroke-square-test-3yn756
Screenshots
Version
156.1
Device
Desktop
Browser
Edge
OS
Windows

