!532 优化,修复格子抽问题

pull/532/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 244ec12d9a
commit 3d3f23b8b2

@ -54,14 +54,17 @@ export class DrawLatticeDrawerTool extends Singleton
let position = space.SpaceBox.min.clone();
let verBr = Board.CreateBoard(size.z, size.y, config.thickness, BoardType.Vertical);
this.WriteBoardProcessOption(verBr);
//分析切角圆弧的结果
let res = this.ParseArcLenOrObliuqeAng(verBr);
if (!res) return;
if (!res)
{
this.End();
return;
};
this.ParseBrTooth(verBr);
this.ParseHighSealing(verBr, config.leftSealed, config.rightSealed, config.upSealed, config.downSealed, false);
this.WriteBoardProcessOption(verBr);
for (let i = 1; i < config.widthCount; i++)
{
let br = verBr.Clone();
@ -74,10 +77,9 @@ export class DrawLatticeDrawerTool extends Singleton
}
let beBr = Board.CreateBoard(size.z, size.x, config.thickness, BoardType.Behind);
this.WriteBoardProcessOption(beBr);
this.ParseBrTooth(beBr);
this.ParseHighSealing(beBr, config.leftSealed, config.rightSealed, config.upSealed, config.downSealed, true);
this.WriteBoardProcessOption(beBr);
for (let i = 1; i < config.depthCount; i++)
{
let br = beBr.Clone();
@ -229,27 +231,26 @@ export class DrawLatticeDrawerTool extends Singleton
if (config.isOpenCut)
{
if (config.upCut > size.z || config.downCut > size.z)
{
log("切角过大");
return false;
}
return true;
if (config.upCut < 1 || config.downCut < 1)
{
log("切角过小");
return false;
}
return true;
let cu = br.ContourCurve as Polyline;
cu.AddVertexAt(3, new Vector2(config.upCut, br.Height));
cu.SetPointAt(4, new Vector2(0, br.Height - config.downCut));
}
else
{
if (config.arcLen > size.z)
if (config.arcLen > size.z || config.arcLen > size.y)
{
log("圆弧角过大");
return false;
}
let cu = br.ContourCurve as Polyline;
if (config.arcLen === 0)
{
log("圆弧角为0");
return true;
}
cu.AddVertexAt(3, new Vector2(config.arcLen, br.Height));
cu.SetBulgeAt(3, Math.tan(Math.PI / 8));
cu.SetPointAt(4, new Vector2(0, br.Height - config.arcLen));

@ -320,9 +320,9 @@ export namespace CheckoutValid
case "thickness":
case "gripWidth":
case "gripDepth":
case "arcLen":
if (safeEval(v) <= 0)
return "数值必须大于0";
case "arcLen":
case "widthCount":
case "depthCount":
case "upSealed":

@ -10,6 +10,7 @@ import { IDirectoryProps } from "../UI/Components/SourceManage/CommonPanel";
import { appUi } from "../UI/Layout/ApplicationLayout";
import { RightPanelStore } from "../UI/Store/RightPanelStore/RightPanelStore";
import { CADFiler } from "./CADFiler";
import { IsDev } from "../Common/Deving";
/**
* Store.Data FileInfo
@ -81,7 +82,7 @@ export class FileServer extends Singleton
}
async AddNewFile()
{
if (!this.isSave && !confirm("您图纸还未保存,是否继续"))
if (!IsDev() && !this.isSave && !confirm("您图纸还未保存,是否继续"))
return;
if (this.m_CurFileId)
{
@ -95,7 +96,7 @@ export class FileServer extends Singleton
{
if (this.m_CurFileId !== fid)
{
if (!this.isSave && !confirm("您当前图纸还未保存,是否继续"))
if (!IsDev() && !this.isSave && !confirm("您当前图纸还未保存,是否继续"))
return;
try
{

@ -215,7 +215,7 @@ export class WineRackModal extends React.Component<{ store?: WineRackStore }, {}
<SetBoardDataBlock
type={CheckObjectType.WR}
className="flexWrap"
pars={[["grooveLengthAdd", "齿加"], ["grooveWidthAdd", "齿加宽"]]}
pars={[["grooveLengthAdd", "齿加"], ["grooveWidthAdd", "齿加宽"]]}
option={m_Option}
uiOption={UIOption}
/>

@ -21,7 +21,7 @@ export class LatticeDrawer extends React.Component<{ store?: LatticeDrawerStore
const pars = [
["knifeRad", "刀半径"], ["thickness", "板厚"],
["downDist", "下沉"], ["space", "间隙"],
["grooveAddWidth", "齿加宽"], ["arcLen", "半径"]
["grooveAddWidth", "齿加宽"]
];
return (
<div
@ -95,13 +95,6 @@ export class LatticeDrawer extends React.Component<{ store?: LatticeDrawerStore
})
}
</div>
<Checkbox
checked={m_Option.isAuto}
label="自动识别半径"
onChange={() =>
{
m_Option.isAuto = !m_Option.isAuto;
}} />
<Checkbox
checked={m_Option.isChange}
label="左右侧板跟随变化"
@ -110,23 +103,49 @@ export class LatticeDrawer extends React.Component<{ store?: LatticeDrawerStore
m_Option.isChange = !m_Option.isChange;
}} />
</div>
<div>
<H5></H5>
<Checkbox
checked={m_Option.isOpenCut}
label="开启"
onChange={() =>
<div style={{ width: 220 }}>
<H5></H5>
<RadioGroup
inline
selectedValue={store.m_Option.isOpenCut ? "1" : "0"}
onChange={(e) =>
{
m_Option.isOpenCut = !m_Option.isOpenCut;
}} />
<SetBoardDataBlock
type={CheckObjectType.Lat}
className="flexWrap"
pars={[["upCut", "上切长"], ["downCut", "下切长"]]}
option={m_Option}
uiOption={UIOption}
disabled={!m_Option.isOpenCut}
/>
m_Option.isOpenCut = e.currentTarget.value === "1";
}}
>
<Radio label="圆角" value="0" />
<Radio label="斜切角" value="1" />
</RadioGroup>
{
m_Option.isOpenCut ? <SetBoardDataBlock
type={CheckObjectType.Lat}
className="flexWrap"
pars={[["upCut", "上切长"], ["downCut", "下切长"]]}
option={m_Option}
uiOption={UIOption}
disabled={!m_Option.isOpenCut}
/> :
<>
<Checkbox
inline
checked={m_Option.isAuto}
label="自动识别半径"
onChange={() =>
{
m_Option.isAuto = !m_Option.isAuto;
}} />
<SetBoardDataItem
inline={true}
type={CheckObjectType.Lat}
optKey="arcLen"
option={m_Option}
uiOption={UIOption}
title="半径"
isDisabled={m_Option.isAuto}
/>
</>
}
<H5></H5>
<Input5Or4Component
type={CheckObjectType.Lat}
showDirectionIcon={true}

Loading…
Cancel
Save