Blog


Learn about industry trends, news and how-tos from our product experts.

CAD

Revolve sketch with arc

var sk1 = new devDept.Geometry.ConstraintSolver.Sketch(); // Create the linear border. var l1 = sk1.AddLine(0, 0, 20, 0); var l2 = sk1.AddLine(20, 0, 20, 10); var l3 = sk1.AddLine(20, 10, 12.4142, 10); var l4 = sk1.AddLine(11.7071, 11.7071, 20, 20); var l5 = sk1.AddLine(20, 20, 0, 20); var l6 = sk1.AddLine(0, 20, 0, 0); // Create the connection arc. Arc arc = new Arc( new Point3D(12.4142, 11, 0), new Point3D(12.4142, 10, 0), new Point3D(11.7071, 11…

by Federico Fucci | February 23, 2023 | Share

CAD

Changing hole diameter in a BRep object

In the following code, we first create a BRep object with a hole, then we change the diameter of a hole with world axis-alignment by editing BRep elements: faces/edges/vertices. Note that this code will work only for radius values that do not intersect/touch the contours of the others faces. devDept.Eyeshot.Entities.Region reg = devDept.Eyeshot.Entities.Region.Creat…

by Alberto Bencivenni | June 30, 2022 | Share

CAD

Modeling Practice Drawings 42

Brep elbow; //creating the first part of the elbow var headRegion = Region.CreateRoundedRectangle(360, 360, 10); for (int i = 0; i < 2; i++) { for (int k = 0; k < 2; k++) { Func<int, int> calcPos = (int pos) => (pos > 0) ? (pos * (360 - 50)) : (pos + 50); var circle = new Circle(calcPos(i), calcPos(k), 0, 15); circle.Reverse(); headRegion.ContourList.Add(circle); } } var headBrep = headRegion.ExtrudeAsBrep(50); foreach(var c in headRegi…

by Gian Maria Gentilini | May 30, 2022 | Share

CAD

Base revolve sketch

Sketch sk1 = new Sketch(); SketchLine[] segments = sk1.AddPolygon( new Point2D(0, 0), new Point2D(130, 0), new Point2D(130, 53), new Point2D(116, 53), new Point2D(116, 37.5), new Point2D(98, 37.5), new Point2D(98, 53), new Point2D(0, 53) ); // hor/ver constraints sk1.AddConstraintHorizontal(segments[0]); sk1.AddConstraintVertical(segments[1]); sk1.AddConstraintHorizontal(segments[2]); sk1.AddConstraint…

by Alberto Bencivenni | May 17, 2022 | Share

CAD

Modeling Practice Drawings 125

The following lines allow you to draw this model in the above picture from scratch: // Body CompositeCurve bodyProfile = new CompositeCurve( new Line(-92, 0, -10, 0), new Arc(-10, 10, 0, 10, Math.PI * 1.5, Math.PI * 2), new Line(0, 10, 0, 77), new Arc(-10, 77, 0, 10, 0, Math.PI / 2), new Line(-10, 87, -92, 87), new Line(-92, 87, -92, 75), new Line(-92, 75, -22, 75), new Arc(-22, 65, 0, 10, 0, Math.PI / 2), new Line(-12, 65, -12, 22), new Arc(-22, 22, 0, 10, Math.PI * 1.5, Math.PI * 2), n…

by Stefano Volpe | October 29, 2021 | Share

CAD

Hook

Let us define some useful constants first: private const string dimLayer = "Dimension", thinLayer = "ThinLayer", dashDot = "DashDot"; private const double textHeight = 5; private const float defaultLineWeight = 2; Here is the primary function: void hook() { hookSetup(); hookFrame(); hookDrawing(); design1.SetView(viewType.Top); design1.ZoomFit(); } Here goes our setup function: void hookS…

by Stefano Volpe | October 25, 2021 | Share

CAD

Casing

Define layer names and text height. const string Dim = "Dim", DashDot = "DashDot", Frame = "Frame", FrameText = "FrameText";const double textHeight = 2.0; Draw the component and its dimensions. // Setting layers and linetype design1.Layers.Add(new Layer(Dim, Color.CornflowerBlue)); design1.Layers.Add(new Layer(Frame) { LineWeight = 2 }); design1.Layers.Add(new Layer(FrameText) { LineWeight = 3 }); de…

by Adriano Ongaretto | August 30, 2021 | Share

CAD

Modeling Practice Drawings 152

Circle c1 = new Circle(new Point3D(0, 0), 30); Circle c2 = new Circle(new Point3D(105, 0), 21); devDept.Eyeshot.Entities.Region creg1 = new devDept.Eyeshot.Entities.Region(c1, Plane.XY); devDept.Eyeshot.Entities.Region creg2 = new devDept.Eyeshot.Entities.Region(c2, Plane.XY); Arc l1top = (Arc) UtilityEx.GetCirclesTangentToTwoCircles(c1, c2,115,true)[3]; Arc l1bottom = new Arc(l1top.Center…

by Alberto Bencivenni | April 09, 2021 | Share

CAD

Swivel Handle

double y1 = 5.62; double y2 = 7.11; Line lineint = new Line(-50, y1, 0, y2);Point3D first = Curve.Intersection(new Circle(new Point3D(0, 0), 15), lineint)[0];Arc a1 = new Arc(new Point3D(0, 0), new Point3D(15, 0), first);Point3D second = Curve.Intersection(new Circle(new Point3D(-50, 0), 14), lineint)[0];Point3D fourth = Curve.Intersection(new Circle(new Point3D(-50, 0), 14), new Line(-50, 5, -100, 5))[0];Arc a2 = new Arc(new Point3…

by Alberto Bencivenni | April 07, 2021 | Share

CAD

CAD Practice Drawings 124

const string Dim = "Dimension", DashDot = "DashDot"; model1.Layers[0].LineWeight = 2; model1.Layers.Add(new Layer(DimLayer, Color.CornflowerBlue)); model1.Layers.Add(new Layer(ThinLayer)); model1.LineTypes.Add(DashDot, new float[] { 30, -5, 5, -5 }); model1.SetView(viewType.Top); int x = 0; int y = 287 / 6 - 20; DrawFrame(); Circle bco = new Circle(x, y, 0, 65); Circle cit = new Circle(x, y + 100, 0, 17); Circle cot = new Circle(x, y + 1…

by Alberto Bencivenni | April 07, 2021 | Share