mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-11 02:45:52 +01:00
taking into account NURBS orientation while ARC-NURBS reconciliating
This commit is contained in:
parent
2a63ae383a
commit
2afc7727db
1 changed files with 18 additions and 1 deletions
|
|
@ -20,11 +20,28 @@ export function getSketchBoundaries(sceneFace) {
|
|||
let arcRadius = findArcRadius(curve2d);
|
||||
if (arcRadius !== null){
|
||||
let [from, to] = curve2d.domain();
|
||||
let [A, DA] = curve2d.eval(from, 1);
|
||||
let [A, DA, DDA] = curve2d.eval(from, 2);
|
||||
let [B, DB] = curve2d.eval(to, 1);
|
||||
|
||||
let mA = vec.normalize(DA);
|
||||
let mmA = vec.normalize(DDA);
|
||||
|
||||
let orient = mA[0] * mmA[1] - mA[1] * mmA[0];
|
||||
|
||||
if (orient < 0) {
|
||||
let t;
|
||||
|
||||
t = B;
|
||||
B = A;
|
||||
A = t;
|
||||
|
||||
t = DB;
|
||||
DB = DA;
|
||||
DA = t;
|
||||
|
||||
mA = vec.normalize(DA);
|
||||
}
|
||||
|
||||
if (veqXYZ(A[0], A[1], 0, B[0], B[1], 0)) {
|
||||
let centripetal = perpXY(vec.mul(mA, arcRadius));
|
||||
let c = vec._add(centripetal, A);
|
||||
|
|
|
|||
Loading…
Reference in a new issue