修复:网洞侧面的法线错误

pull/1906/MERGE
ChenX 2 years ago
parent df458050ee
commit 699864a18a

@ -10,9 +10,8 @@ import { Factory } from "../../../../CADFactory";
import { CADFiler } from "../../../../CADFiler";
import { CADObject } from "../../../../CADObject";
import { Curve } from "../../../../Entity/Curve";
import { Line } from "../../../../Entity/Line";
import { Polyline } from "../../../../Entity/Polyline";
import { CreateGetCurveParam, GetLineParam } from "../../../ParseService/GetCurveParam";
import { LEFT_ROTATE_MTX2 } from "../../../ParseService/GetCurveParam";
import { RoomWallBase } from "../RoomWallBase";
import { RoomWallLine } from "../RoomWallLine";
import { RoomHoleBase } from "./RoomHoleBase";
@ -237,11 +236,12 @@ export class RoomHolePolyline extends RoomHoleBase
let startZ = 0;
let endZ = this._Height * 1e-3;
let parse = CreateGetCurveParam(lid as Line) as GetLineParam;
let normal = p2.clone().sub(p1).normalize();
LEFT_ROTATE_MTX2.applyVector(normal);
geo.faces.push(
new Face3(startIndex, startIndex + 2, startIndex + 1, parse.RightDir),
new Face3(startIndex + 1, startIndex + 2, startIndex + 3, parse.RightDir),
new Face3(startIndex, startIndex + 2, startIndex + 1, normal),
new Face3(startIndex + 1, startIndex + 2, startIndex + 3, normal),
);
geo.faceVertexUvs[0].push(

Loading…
Cancel
Save