Added hole tool and moved the workbench folders arrround a bit
|
|
@ -0,0 +1 @@
|
|||
place holder
|
||||
|
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 729 B |
130
modules/workbenches/modeler/features/hole_tool/index.ts
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'hole_tool',
|
||||
label: 'hole_tool',
|
||||
icon,
|
||||
info: 'hole_tool',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter,
|
||||
depth,
|
||||
counterBoreDiameter,
|
||||
counterBoreDepth,
|
||||
countersinkDiameter,
|
||||
countersinkAngle,
|
||||
holeType, }) => `(${r(depth)} ${r(counterBoreDiameter)}) ${r(counterBoreDepth)})`,
|
||||
run: ({
|
||||
diameter,
|
||||
depth,
|
||||
counterBoreDiameter,
|
||||
counterBoreDepth,
|
||||
countersinkDiameter,
|
||||
countersinkAngle,
|
||||
holeType,
|
||||
}, ctx: ApplicationContext) => {
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const cylinderCenterline = oc.gp.DZ();
|
||||
const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, diameter / 2, depth,);
|
||||
|
||||
|
||||
if (holeType == "counterbore") {
|
||||
let counterboreItem = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, counterBoreDiameter, counterBoreDepth,);
|
||||
myBody = new oc.BRepAlgoAPI_Fuse_3(myBody.Shape(), counterboreItem.Shape());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (holeType == "countersink") {
|
||||
let heightFromDiameterAndAngle = (countersinkDiameter - diameter) / (2 * Math.tan((countersinkAngle / 180 * Math.PI) / 2));
|
||||
let countersinkItem = new oc.BRepPrimAPI_MakeCone_1(countersinkDiameter / 2, diameter / 2, heightFromDiameterAndAngle);
|
||||
myBody = new oc.BRepAlgoAPI_Fuse_3(myBody.Shape(), countersinkItem.Shape());
|
||||
}
|
||||
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 10,
|
||||
label: 'Hole ⌀'
|
||||
},
|
||||
depth: {
|
||||
type: 'number',
|
||||
defaultValue: 100,
|
||||
label: 'Hole ↧'
|
||||
},
|
||||
|
||||
|
||||
holeType: {
|
||||
type: 'TextField',
|
||||
defaultValue: "counterbore",
|
||||
label: 'HoleType',
|
||||
children: [
|
||||
"counterbore",
|
||||
"countersink",
|
||||
"normal",
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
counterBoreDiameter: {
|
||||
type: 'number',
|
||||
defaultValue: 20,
|
||||
label: '⌴ ⌀'
|
||||
},
|
||||
counterBoreDepth: {
|
||||
type: 'number',
|
||||
defaultValue: 10,
|
||||
label: '⌴ ↧'
|
||||
},
|
||||
|
||||
|
||||
|
||||
countersinkDiameter: {
|
||||
type: 'number',
|
||||
defaultValue: 20,
|
||||
label: '⌵ ⌀'
|
||||
},
|
||||
countersinkAngle: {
|
||||
type: 'number',
|
||||
defaultValue: 90,
|
||||
label: '⌵ Angle'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'hole',
|
||||
label: 'hole',
|
||||
icon,
|
||||
info: 'hole',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, depth, counterBoreDiameter, counterBoreDepth, countersinkDiameter, countersinkAngle,}) => `(${r(diameter)} ${r(depth)})`,
|
||||
run: ({ diameter, depth, counterBoreDiameter, counterBoreDepth, countersinkDiameter, countersinkAngle, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const cylinderCenterline = oc.gp.DZ();
|
||||
const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
|
||||
|
||||
let primaryHole = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, diameter, depth,);
|
||||
|
||||
|
||||
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, primaryHole.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 10,
|
||||
label: 'diameter'
|
||||
},
|
||||
depth: {
|
||||
type: 'number',
|
||||
defaultValue: 100,
|
||||
label: 'depth'
|
||||
},
|
||||
|
||||
|
||||
|
||||
counterBoreDiameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
counterBoreDepth: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'counterBoreDepth'
|
||||
},
|
||||
|
||||
|
||||
|
||||
countersinkDiameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'countersinkDiameter'
|
||||
},
|
||||
countersinkAngle: {
|
||||
type: 'number',
|
||||
defaultValue: 90,
|
||||
label: 'Countersink Angle'
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
export function createOCCBottle(myWidth: number, myHeight: number, myThickness: number, oc: any) {
|
||||
|
||||
const aPnt1 = new oc.gp_Pnt_3(-myWidth / 2., 0, 0);
|
||||
const aPnt2 = new oc.gp_Pnt_3(-myWidth / 2., -myThickness / 4., 0);
|
||||
const aPnt3 = new oc.gp_Pnt_3(0, -myThickness / 2., 0);
|
||||
const aPnt4 = new oc.gp_Pnt_3(myWidth / 2., -myThickness / 4., 0);
|
||||
const aPnt5 = new oc.gp_Pnt_3(myWidth / 2., 0, 0);
|
||||
|
||||
// Profile : Define the Geometry
|
||||
const anArcOfCircle = new oc.GC_MakeArcOfCircle_4(aPnt2, aPnt3, aPnt4);
|
||||
const aSegment1 = new oc.GC_MakeSegment_1(aPnt1, aPnt2);
|
||||
const aSegment2 = new oc.GC_MakeSegment_1(aPnt4, aPnt5);
|
||||
|
||||
// Profile : Define the Topology
|
||||
const anEdge1 = new oc.BRepBuilderAPI_MakeEdge_24(new oc.Handle_Geom_Curve_2(aSegment1.Value().get()));
|
||||
const anEdge2 = new oc.BRepBuilderAPI_MakeEdge_24(new oc.Handle_Geom_Curve_2(anArcOfCircle.Value().get()));
|
||||
const anEdge3 = new oc.BRepBuilderAPI_MakeEdge_24(new oc.Handle_Geom_Curve_2(aSegment2.Value().get()));
|
||||
const aWire = new oc.BRepBuilderAPI_MakeWire_4(anEdge1.Edge(), anEdge2.Edge(), anEdge3.Edge());
|
||||
|
||||
// Complete Profile
|
||||
const xAxis = oc.gp.OX();
|
||||
const aTrsf = new oc.gp_Trsf_1();
|
||||
|
||||
aTrsf.SetMirror_2(xAxis);
|
||||
const aBRepTrsf = new oc.BRepBuilderAPI_Transform_2(aWire.Wire(), aTrsf, false);
|
||||
const aMirroredShape = aBRepTrsf.Shape();
|
||||
|
||||
const mkWire = new oc.BRepBuilderAPI_MakeWire_1();
|
||||
mkWire.Add_2(aWire.Wire());
|
||||
mkWire.Add_2(oc.TopoDS.Wire_1(aMirroredShape));
|
||||
const myWireProfile = mkWire.Wire();
|
||||
|
||||
// Body : Prism the Profile
|
||||
const myFaceProfile = new oc.BRepBuilderAPI_MakeFace_15(myWireProfile, false);
|
||||
const aPrismVec = new oc.gp_Vec_4(0, 0, myHeight);
|
||||
let myBody = new oc.BRepPrimAPI_MakePrism_1(myFaceProfile.Face(), aPrismVec, false, true);
|
||||
|
||||
// Body : Apply Fillets
|
||||
const mkFillet = new oc.BRepFilletAPI_MakeFillet(myBody.Shape(), oc.ChFi3d_FilletShape.ChFi3d_Rational);
|
||||
const anEdgeExplorer = new oc.TopExp_Explorer_2(myBody.Shape(), oc.TopAbs_ShapeEnum.TopAbs_EDGE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
||||
while(anEdgeExplorer.More()) {
|
||||
const anEdge = oc.TopoDS.Edge_1(anEdgeExplorer.Current());
|
||||
// Add edge to fillet algorithm
|
||||
mkFillet.Add_2(myThickness / 12., anEdge);
|
||||
anEdgeExplorer.Next();
|
||||
}
|
||||
myBody = mkFillet.Shape();
|
||||
|
||||
// Body : Add the Neck
|
||||
const neckLocation = new oc.gp_Pnt_3(0, 0, myHeight);
|
||||
const neckAxis = oc.gp.DZ();
|
||||
const neckAx2 = new oc.gp_Ax2_3(neckLocation, neckAxis);
|
||||
|
||||
const myNeckRadius = myThickness / 4.;
|
||||
const myNeckHeight = myHeight / 10.;
|
||||
|
||||
const MKCylinder = new oc.BRepPrimAPI_MakeCylinder_3(neckAx2, myNeckRadius, myNeckHeight);
|
||||
const myNeck = MKCylinder.Shape();
|
||||
|
||||
myBody = new oc.BRepAlgoAPI_Fuse_3(myBody, myNeck);
|
||||
|
||||
// Body : Create a Hollowed Solid
|
||||
let faceToRemove;
|
||||
let zMax = -1;
|
||||
const aFaceExplorer = new oc.TopExp_Explorer_2(myBody.Shape(), oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE);
|
||||
for(; aFaceExplorer.More(); aFaceExplorer.Next()) {
|
||||
const aFace = oc.TopoDS.Face_1(aFaceExplorer.Current());
|
||||
// Check if <aFace> is the top face of the bottle's neck
|
||||
const aSurface = oc.BRep_Tool.Surface_2(aFace);
|
||||
if(aSurface.get().$$.ptrType.name === "Geom_Plane*") {
|
||||
const aPlane = new oc.Handle_Geom_Plane_2(aSurface.get()).get();
|
||||
const aPnt = aPlane.Location();
|
||||
const aZ = aPnt.Z();
|
||||
if(aZ > zMax) {
|
||||
zMax = aZ;
|
||||
faceToRemove = new oc.TopExp_Explorer_2(aFace, oc.TopAbs_ShapeEnum.TopAbs_FACE, oc.TopAbs_ShapeEnum.TopAbs_SHAPE).Current();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const facesToRemove = new oc.TopTools_ListOfShape_1();
|
||||
facesToRemove.Append_1(faceToRemove);
|
||||
const s = myBody.Shape();
|
||||
myBody = new oc.BRepOffsetAPI_MakeThickSolid_1();
|
||||
myBody.MakeThickSolidByJoin(s, facesToRemove, -myThickness / 50, 1.e-3, oc.BRepOffset_Mode.BRepOffset_Skin, false, false, oc.GeomAbs_JoinType.GeomAbs_Arc, false);
|
||||
// Threading : Create Surfaces
|
||||
const aCyl1 = new oc.Geom_CylindricalSurface_1(new oc.gp_Ax3_2(neckAx2), myNeckRadius * 0.99);
|
||||
const aCyl2 = new oc.Geom_CylindricalSurface_1(new oc.gp_Ax3_2(neckAx2), myNeckRadius * 1.05);
|
||||
|
||||
// Threading : Define 2D Curves
|
||||
const aPnt = new oc.gp_Pnt2d_3(2. * Math.PI, myNeckHeight / 2.);
|
||||
const aDir = new oc.gp_Dir2d_4(2. * Math.PI, myNeckHeight / 4.);
|
||||
const anAx2d = new oc.gp_Ax2d_2(aPnt, aDir);
|
||||
|
||||
const aMajor = 2. * Math.PI;
|
||||
const aMinor = myNeckHeight / 10;
|
||||
|
||||
const anEllipse1 = new oc.Geom2d_Ellipse_2(anAx2d, aMajor, aMinor, true);
|
||||
const anEllipse2 = new oc.Geom2d_Ellipse_2(anAx2d, aMajor, aMinor / 4, true);
|
||||
const anArc1 = new oc.Geom2d_TrimmedCurve(new oc.Handle_Geom2d_Curve_2(anEllipse1), 0, Math.PI, true, true);
|
||||
const anArc2 = new oc.Geom2d_TrimmedCurve(new oc.Handle_Geom2d_Curve_2(anEllipse2), 0, Math.PI, true, true);
|
||||
const tmp1 = anEllipse1.Value(0);
|
||||
const anEllipsePnt1 = new oc.gp_Pnt2d_3(tmp1.X(), tmp1.Y());
|
||||
const tmp2 = anEllipse1.Value(Math.PI);
|
||||
const anEllipsePnt2 = new oc.gp_Pnt2d_3(tmp2.X(), tmp2.Y());
|
||||
|
||||
const aSegment = new oc.GCE2d_MakeSegment_1(anEllipsePnt1, anEllipsePnt2);
|
||||
// Threading : Build Edges and Wires
|
||||
const anEdge1OnSurf1 = new oc.BRepBuilderAPI_MakeEdge_30(new oc.Handle_Geom2d_Curve_2(anArc1), new oc.Handle_Geom_Surface_2(aCyl1));
|
||||
const anEdge2OnSurf1 = new oc.BRepBuilderAPI_MakeEdge_30(new oc.Handle_Geom2d_Curve_2(aSegment.Value().get()), new oc.Handle_Geom_Surface_2(aCyl1));
|
||||
const anEdge1OnSurf2 = new oc.BRepBuilderAPI_MakeEdge_30(new oc.Handle_Geom2d_Curve_2(anArc2), new oc.Handle_Geom_Surface_2(aCyl2));
|
||||
const anEdge2OnSurf2 = new oc.BRepBuilderAPI_MakeEdge_30(new oc.Handle_Geom2d_Curve_2(aSegment.Value().get()), new oc.Handle_Geom_Surface_2(aCyl2));
|
||||
const threadingWire1 = new oc.BRepBuilderAPI_MakeWire_3(anEdge1OnSurf1.Edge(), anEdge2OnSurf1.Edge());
|
||||
const threadingWire2 = new oc.BRepBuilderAPI_MakeWire_3(anEdge1OnSurf2.Edge(), anEdge2OnSurf2.Edge());
|
||||
oc.BRepLib.BuildCurves3d_2(threadingWire1.Wire());
|
||||
oc.BRepLib.BuildCurves3d_2(threadingWire2.Wire());
|
||||
oc.BRepLib.BuildCurves3d_2(threadingWire1.Wire());
|
||||
oc.BRepLib.BuildCurves3d_2(threadingWire2.Wire());
|
||||
|
||||
// Create Threading
|
||||
const aTool = new oc.BRepOffsetAPI_ThruSections(true, false, 1.0e-06);
|
||||
aTool.AddWire(threadingWire1.Wire());
|
||||
aTool.AddWire(threadingWire2.Wire());
|
||||
aTool.CheckCompatibility(false);
|
||||
|
||||
const myThreading = aTool.Shape();
|
||||
|
||||
// Building the Resulting Compound
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
aBuilder.Add(aRes, myThreading);
|
||||
|
||||
return aRes;
|
||||
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { createOCCBottle } from './bottle.occ';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'OCC_BOTTLE',
|
||||
label: 'OCC Bottle',
|
||||
icon,
|
||||
info: 'create occ bottle',
|
||||
mutualExclusiveFields: [],
|
||||
|
||||
|
||||
paramsInfo: ({ width, height, thickness }) => `(${r(width)} ${r(height)} ${r(thickness)})`,
|
||||
run: ({ width, height, thickness }, ctx: ApplicationContext) => {
|
||||
const occObj = createOCCBottle(width, height, thickness, ctx.occService.occContext);
|
||||
const mobject = new MBrepShell(occ2brep(occObj, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
width: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'width'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
thickness: {
|
||||
type: 'number',
|
||||
min: 0,
|
||||
label: 'thickness',
|
||||
defaultValue: 150
|
||||
}
|
||||
}
|
||||
}
|
||||
10
modules/workbenches/modeler/features/primitive_box/icon.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 512 512">
|
||||
<g>
|
||||
<g>
|
||||
<path d="m409.1,150.1h-306.2c-11.3,0-20.4,9.1-20.4,20.4v310.1c0,11.3 9.1,20.4 20.4,20.4h306.3c11.3,0 20.4-9.1 20.4-20.4v-310.1c-0.1-11.3-9.2-20.4-20.5-20.4zm-20.4,310.1h-265.4v-269.3h265.4v269.3z"/>
|
||||
<path d="m170,135.9h175c11.3,0 20.4-9.1 20.4-20.4v-84.1c0-11.3-9.1-20.4-20.4-20.4h-175c-11.3,0-20.4,9.1-20.4,20.4v84.1c-0.1,11.3 9.1,20.4 20.4,20.4zm20.4-84.1h134.2v43.3h-134.2v-43.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 729 B |
|
|
@ -2,11 +2,12 @@ import { ApplicationContext } from 'context';
|
|||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'primitive_box',
|
||||
label: 'primitive_box',
|
||||
icon: 'img/cad/extrude',
|
||||
icon,
|
||||
info: 'primitive_box',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ boxX, boxY, boxZ }) => `(${r(boxX)} ${r(boxY)}) ${r(boxZ)})`,
|
||||
|
|
|
|||
10
modules/workbenches/modeler/features/primitive_cone/icon.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 512 512">
|
||||
<g>
|
||||
<g>
|
||||
<path d="m409.1,150.1h-306.2c-11.3,0-20.4,9.1-20.4,20.4v310.1c0,11.3 9.1,20.4 20.4,20.4h306.3c11.3,0 20.4-9.1 20.4-20.4v-310.1c-0.1-11.3-9.2-20.4-20.5-20.4zm-20.4,310.1h-265.4v-269.3h265.4v269.3z"/>
|
||||
<path d="m170,135.9h175c11.3,0 20.4-9.1 20.4-20.4v-84.1c0-11.3-9.1-20.4-20.4-20.4h-175c-11.3,0-20.4,9.1-20.4,20.4v84.1c-0.1,11.3 9.1,20.4 20.4,20.4zm20.4-84.1h134.2v43.3h-134.2v-43.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 729 B |
|
|
@ -2,11 +2,12 @@ import { ApplicationContext } from 'context';
|
|||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cone',
|
||||
label: 'primitive_cone',
|
||||
icon: 'img/cad/extrude',
|
||||
icon,
|
||||
info: 'primitive_cone',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 512 512">
|
||||
<g>
|
||||
<g>
|
||||
<path d="m409.1,150.1h-306.2c-11.3,0-20.4,9.1-20.4,20.4v310.1c0,11.3 9.1,20.4 20.4,20.4h306.3c11.3,0 20.4-9.1 20.4-20.4v-310.1c-0.1-11.3-9.2-20.4-20.5-20.4zm-20.4,310.1h-265.4v-269.3h265.4v269.3z"/>
|
||||
<path d="m170,135.9h175c11.3,0 20.4-9.1 20.4-20.4v-84.1c0-11.3-9.1-20.4-20.4-20.4h-175c-11.3,0-20.4,9.1-20.4,20.4v84.1c-0.1,11.3 9.1,20.4 20.4,20.4zm20.4-84.1h134.2v43.3h-134.2v-43.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 729 B |
|
|
@ -2,11 +2,12 @@ import { ApplicationContext } from 'context';
|
|||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cylinder',
|
||||
label: 'primitive_cylinder',
|
||||
icon: 'img/cad/extrude',
|
||||
icon,
|
||||
info: 'primitive_cylinder',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 512 512">
|
||||
<g>
|
||||
<g>
|
||||
<path d="m409.1,150.1h-306.2c-11.3,0-20.4,9.1-20.4,20.4v310.1c0,11.3 9.1,20.4 20.4,20.4h306.3c11.3,0 20.4-9.1 20.4-20.4v-310.1c-0.1-11.3-9.2-20.4-20.5-20.4zm-20.4,310.1h-265.4v-269.3h265.4v269.3z"/>
|
||||
<path d="m170,135.9h175c11.3,0 20.4-9.1 20.4-20.4v-84.1c0-11.3-9.1-20.4-20.4-20.4h-175c-11.3,0-20.4,9.1-20.4,20.4v84.1c-0.1,11.3 9.1,20.4 20.4,20.4zm20.4-84.1h134.2v43.3h-134.2v-43.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 729 B |
|
|
@ -2,11 +2,12 @@ import { ApplicationContext } from 'context';
|
|||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.svg';
|
||||
|
||||
export default {
|
||||
id: 'primitive_sphere',
|
||||
label: 'primitive_sphere',
|
||||
icon: 'img/cad/extrude',
|
||||
icon,
|
||||
info: 'primitive_sphere',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter }) => `(${r(diameter)} )`,
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
|
@ -2,11 +2,12 @@ import { ApplicationContext } from 'context';
|
|||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import icon from './icon.png';
|
||||
|
||||
export default {
|
||||
id: 'primitive_torus',
|
||||
label: 'primitive_torus',
|
||||
icon: 'img/cad/extrude',
|
||||
icon,
|
||||
info: 'primitive_torus',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ radius, tubeRadius }) => `(${r(radius)} ${r(tubeRadius)} )`,
|
||||
|
|
|
|||
|
|
@ -5,17 +5,18 @@ import primitive_cone from './features/primitive_cone';
|
|||
import primitive_cylinder from './features/primitive_cylinder';
|
||||
import primitive_sphere from './features/primitive_sphere';
|
||||
import primitive_torus from './features/primitive_torus';
|
||||
import hole_tool from './features/hole_tool';
|
||||
|
||||
export default {
|
||||
|
||||
workbenchId: 'modeler',
|
||||
features: [
|
||||
EXTRUDE,
|
||||
OCC_BOTTLE,
|
||||
primitive_box,
|
||||
primitive_cone,
|
||||
primitive_cylinder,
|
||||
primitive_sphere,
|
||||
primitive_torus
|
||||
primitive_torus,
|
||||
hole_tool,
|
||||
]
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ export default [
|
|||
id: 'craft',
|
||||
cssIcons: ['magic'],
|
||||
info: 'set of available craft operations on a solid',
|
||||
actions: ['EXTRUDE', 'CUT', 'REVOLVE', 'LOFT', 'SHELL', 'FILLET', 'DATUM_CREATE']
|
||||
actions: ['EXTRUDE', 'CUT', 'REVOLVE', 'LOFT', 'SHELL', 'FILLET', 'DATUM_CREATE', ]
|
||||
},
|
||||
{
|
||||
id: 'primitives',
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ import Expressions from '../expressions/Expressions';
|
|||
import {SelectionView} from "../dom/components/SelectionView";
|
||||
import {GrSelect} from "react-icons/gr";
|
||||
|
||||
export const STANDARD_MODE_HEADS_UP_TOOLBAR = ['DATUM_CREATE', 'PLANE', 'EditFace', 'EXTRUDE', 'CUT', 'REVOLVE', 'LOFT',
|
||||
'-', 'FILLET', '-', 'INTERSECTION', 'SUBTRACT', 'UNION', '-', 'IMPORT_PART', "IMPORT_STEP_FILE", "IMPORT_STEP_LOCAL_FILE",
|
||||
"ExportFaceToDXF", 'OCC_BOTTLE', "primitive_cylinder", "primitive_box", "primitive_cone", "primitive_sphere","primitive_torus"];
|
||||
export const STANDARD_MODE_HEADS_UP_TOOLBAR = ['DATUM_CREATE', 'PLANE', 'EditFace', '-', 'INTERSECTION', 'SUBTRACT', 'UNION', '-', "primitive_cylinder", "primitive_box", "primitive_cone", "primitive_sphere", "primitive_torus", "hole_tool", ];
|
||||
|
||||
export function activate({services, streams}) {
|
||||
streams.ui.controlBars.left.value = ['menu.file', 'menu.craft', 'menu.boolean', 'menu.primitives', 'menu.views', 'Donate', 'GitHub'];
|
||||
|
|
|
|||