修正多段线转Lisp时存在坐标系导致的位置错误

pull/215/MERGE
ChenX 6 years ago
parent b6a5fe1cb2
commit 833132bfb6

@ -2,6 +2,7 @@ import { app } from "../ApplicationServices/Application";
import { copyTextToClipboard } from "../Common/Utils"; import { copyTextToClipboard } from "../Common/Utils";
import { Polyline } from "../DatabaseServices/Polyline"; import { Polyline } from "../DatabaseServices/Polyline";
import { PromptStatus } from "../Editor/PromptResult"; import { PromptStatus } from "../Editor/PromptResult";
import { Vector3 } from "three";
export class Command_Lisp export class Command_Lisp
{ {
@ -33,6 +34,14 @@ export class Command_Lisp
` `
let str = fun + "(cx-make-pline '("; let str = fun + "(cx-make-pline '(";
let ocs = pl.OCS;
pts.forEach(p =>
{
let p3 = new Vector3(p.x, p.y);
p3.applyMatrix4(ocs);
p.set(p3.x, p3.y);
})
pts.forEach(p => str += `(${p.x} ${p.y})`) pts.forEach(p => str += `(${p.x} ${p.y})`)
str += ") '("; str += ") '(";
buls.forEach(b => str += `${b} `); buls.forEach(b => str += `${b} `);

Loading…
Cancel
Save