mirror of https://gitee.com/cf-fz/WebCAD.git
parent
9a0ef8b41d
commit
e27633536c
@ -1,20 +1,25 @@
|
||||
import { CADFiler } from "../../DatabaseServices/CADFiler";
|
||||
import { Ellipse } from "../../DatabaseServices/Entity/Ellipse";
|
||||
import { Region } from "../../DatabaseServices/Entity/Region";
|
||||
import { Command } from "../../Editor/CommandMachine";
|
||||
import { BoolOpeartionType } from "../../GraphicsSystem/BoolOperateUtils";
|
||||
import { HotCMD } from "../../Hot/HotCommand";
|
||||
import { TestDraw } from "../test/TestUtil";
|
||||
|
||||
@HotCMD
|
||||
export class Test implements Command
|
||||
{
|
||||
async exec()
|
||||
{
|
||||
let d = { "file": [2, "Ellipse", 10, 2, 103, 0, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 983.9770911100416, 940.0742538149107, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1926.3535339862863, 877.8288804632223, 0, 1], 0, 0, 1, 1, 418.15520838547974, 225.54490978414745, -0.69713252541264, 6.343188564109003, 7.616407379765725, "Ellipse", 10, 2, 104, 0, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 983.9770911100406, 940.0742538149093, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1926.3535339862863, 877.8288804632223, 0, 1], 0, 0, 1, 1, 418.15520838547974, 225.54490978414745, -0.69713252541264, 3.934994981148553, 6.34318856410901], "basePt": { "x": 655.8960059049625, "y": 620.7541549379562, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||
let d = { "file": [2, "Region", 10, 2, 110, 0, 1, 7, 71, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 863.9997678387444, -200, 0, 1], 0, 0, 1, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 863.9997678387444, -200, 0, 1], 0, 0, 1, 1, 1, 1, 1, "Polyline", 10, 2, 0, 0, 0, 1, 71, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 863.9997678387444, -200, 0, 1], 0, 0, 1, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 863.9997678387444, -200, 0, 1], 0, 0, 1, 2, 4, [100, 0], 0, [400, 0], 0, [400, 864], 0, [100, 864], 0, true, 0, "Region", 10, 2, 111, 0, 1, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, 1, 1, 1, 1, "Polyline", 10, 2, 0, 0, 0, 2, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -614.9118387909318, -117.20906801007538, 0, 1], 0, 0, 1, 2, 4, [0, 0], 0, [1728.0001196034718, 0], 0, [1728.0001196034718, 9.5], 0, [0, 9.5], 0, true, 0], "basePt": { "x": -0.00023216125555336475, "y": -100, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||
let f = new CADFiler(d.file);
|
||||
|
||||
f.Read();
|
||||
let el1 = f.ReadObject() as Ellipse;
|
||||
let el2 = f.ReadObject() as Ellipse;
|
||||
let el1 = f.ReadObject() as Region;
|
||||
let el2 = f.ReadObject() as Region;
|
||||
|
||||
el1.Join(el2);
|
||||
TestDraw(el1.Clone());
|
||||
TestDraw(el2.Clone());
|
||||
|
||||
el1.BooleanOper(el2, BoolOpeartionType.Intersection);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue