mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
fix width of scalable lines
This commit is contained in:
parent
1ccf2e937f
commit
69465945d1
3 changed files with 3 additions and 4 deletions
|
|
@ -23,7 +23,7 @@ export default class ScalableLine extends Mesh {
|
|||
let modelSize = 1;
|
||||
let modelSizePx = this.width;
|
||||
let k = viewScaleFactor(sceneSetup, ORIGIN, modelSizePx, modelSize);
|
||||
let morphDistance = (k * modelSize - modelSize) / 2;
|
||||
let morphDistance = k * modelSize / 2 - modelSize;
|
||||
this.morphTargetInfluences[0] = morphDistance / morphBase;
|
||||
super.updateMatrix();
|
||||
}
|
||||
|
|
@ -54,7 +54,6 @@ function createGeometry(tessellation, smooth) {
|
|||
const width = 1;
|
||||
const geometry = new Geometry();
|
||||
const scaleTargets = [];
|
||||
const morphBase = 10;
|
||||
geometry.dynamic = true;
|
||||
let tess = tessellation;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ export class EdgeView extends CurveBasedView {
|
|||
constructor(edge) {
|
||||
let brepEdge = edge.brepEdge;
|
||||
let tess = brepEdge.data.tesselation ? brepEdge.data.tesselation : brepEdge.curve.tessellateToData();
|
||||
super(edge, tess, 1, 2, 0x2B3856, 0xd1726c);
|
||||
super(edge, tess, 2, 3, 0x2B3856, 0xd1726c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ export class SketchObjectView extends CurveBasedView {
|
|||
constructor(mSketchObject, sketchToWorldTransformation) {
|
||||
const color = mSketchObject.construction ? 0x777777 : 0xFFFFFF;
|
||||
const tess = mSketchObject.sketchPrimitive.tessellate(10).map(sketchToWorldTransformation.apply).map(v => v.data());
|
||||
super(mSketchObject, tess, 0.3, 1, color, 0x49FFA5);
|
||||
super(mSketchObject, tess, 1, 2, color, 0x49FFA5);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue