开发:模拟优化结果

pull/2447/MERGE
ChenX 12 months ago
parent 76bd08075f
commit 0d65497cfb

@ -270,7 +270,7 @@ import { TemplateArray, TemplateAttach, TemplateAttach2 } from "../DatabaseServi
import { DbText } from "../DatabaseServices/Text/Text"; import { DbText } from "../DatabaseServices/Text/Text";
import { RenderType } from "../GraphicsSystem/RenderType"; import { RenderType } from "../GraphicsSystem/RenderType";
import { Command_TestContainer } from "../Nest/Test/TestContainer"; import { Command_TestContainer } from "../Nest/Test/TestContainer";
import { Command_TestDrawYHData } from "../Nest/Test/TestDrawYHData"; import { Command_TestDrawYHData, Command_TestDrawYHData2 } from "../Nest/Test/TestDrawYHData";
import { Command_TestNFP } from "../Nest/Test/TestNFP"; import { Command_TestNFP } from "../Nest/Test/TestNFP";
import { Command_TestPlace } from "../Nest/Test/TestPlace"; import { Command_TestPlace } from "../Nest/Test/TestPlace";
import { Command_TestParseOddments } from "../Nest/Test/TestPraseOddments"; import { Command_TestParseOddments } from "../Nest/Test/TestPraseOddments";
@ -694,6 +694,7 @@ export function registerCommand()
commandMachine.RegisterCommand("testYH2", new Command_TestYH2()); commandMachine.RegisterCommand("testYH2", new Command_TestYH2());
commandMachine.RegisterCommand("testYHSingle", new Command_TestYHSingle()); commandMachine.RegisterCommand("testYHSingle", new Command_TestYHSingle());
commandMachine.RegisterCommand("testYHDraw", new Command_TestDrawYHData()); commandMachine.RegisterCommand("testYHDraw", new Command_TestDrawYHData());
commandMachine.RegisterCommand("testYHDraw2", new Command_TestDrawYHData2());
commandMachine.RegisterCommand("testYHSave", new Command_TestSaveYHData()); commandMachine.RegisterCommand("testYHSave", new Command_TestSaveYHData());
commandMachine.RegisterCommand("testSum", new Command_TestSum()); commandMachine.RegisterCommand("testSum", new Command_TestSum());
commandMachine.RegisterCommand("TestSimplyOddments", new Command_TestSimplyOddments()); commandMachine.RegisterCommand("TestSimplyOddments", new Command_TestSimplyOddments());

@ -44,8 +44,7 @@ export class Command_TestDrawYHData implements Command
let cus: Curve[] = []; let cus: Curve[] = [];
part.UserData = cus; part.UserData = cus;
let state = part.RotatedStates[0]; let state = part.RotatedStates[0];
let pts = state.Contour.Points.map(p => new Vector3(p.x * 1, p.y * 1)); let pl = Path2Polyline(state.Contour.Points);
let pl = Path2Polyline(pts);
cus.push(pl); cus.push(pl);
let ocs = new Matrix4; let ocs = new Matrix4;
if (state.Rotation !== 0) if (state.Rotation !== 0)
@ -124,3 +123,49 @@ export class Command_TestDrawYHData implements Command
} }
} }
} }
/**
* 使
*/
@HotCMD
export class Command_TestDrawYHData2 implements Command
{
async exec()
{
//database data 请提供db数据
let dd = [];
//place data 请提供place数据
let pd = [];
let df = new NestFiler(dd);
let pf = new NestFiler(pd);
let db = new NestDatabase().ReadFile(df);
for (let part of db.Parts)
{
let state = part.State;
let pl = Path2Polyline(state.Contour.Points);
TestDraw(pl);
part.UserData = [pl];
let ocs = new Matrix4;
if (state.Rotation !== 0)
ocs.makeRotationZ(-state.Rotation);
ocs.setPosition(state.OrigionMinPoint.x, state.OrigionMinPoint.y, 0);
NestVariant.curveMap.set(pl, ocs);
for (let h of part.Holes)
{
let pl = Path2Polyline(h.Contour.Points);
TestDraw(pl);
part.UserData.push(pl);
NestVariant.curveMap.set(pl, new Matrix4().setPosition(h.OrigionMinPoint.x, h.OrigionMinPoint.y, 0));
}
}
let inv = new Individual(db.Parts);
inv.ReadFile(pf);
Place(inv, db.Parts, db.Bin);
}
}

Loading…
Cancel
Save