public void SolidDeflate() { var body = TestGeomGenerator.CreateImprint().Body; var offset = Offset.Create(body, -0.5); Assert.IsTrue(offset.Make(Shape.MakeFlags.None)); AssertHelper.IsSameModel(offset, Path.Combine(_BasePath, "SolidDeflate")); }
public void SketchDiscardOriginal() { var sketch = TestSketchGenerator.CreateSketch(TestSketchGenerator.SketchType.Circle, true); var offset = Offset.Create(sketch.Body, -4.0); offset.KeepOriginal = false; Assert.IsTrue(offset.Make(Shape.MakeFlags.None)); AssertHelper.IsSameModel(offset, Path.Combine(_BasePath, $"SketchDiscardOriginal")); }
public void SketchDeflate(TestSketchGenerator.SketchType sketchType) { var sketch = TestSketchGenerator.CreateSketch(sketchType, true); var offset = Offset.Create(sketch.Body, -1.0); offset.KeepOriginal = true; Assert.IsTrue(offset.Make(Shape.MakeFlags.None)); AssertHelper.IsSameModel(offset, Path.Combine(_BasePath, $"SketchDeflate_{sketchType}")); }
public void SolidCorner(Offset.CornerType corner) { var body = TestGeomGenerator.CreateBox().Body; var offset = Offset.Create(body, 1.0); offset.Corner = corner; Assert.IsTrue(offset.Make(Shape.MakeFlags.None)); AssertHelper.IsSameModel(offset, Path.Combine(_BasePath, $"SolidCorner_{corner}")); }
public void SketchCorner(Offset.CornerType corner) { var sketch = TestSketchGenerator.CreateSketch(TestSketchGenerator.SketchType.SimpleAsymmetric, true); var offset = Offset.Create(sketch.Body, 2.0); offset.KeepOriginal = true; offset.Corner = corner; Assert.IsTrue(offset.Make(Shape.MakeFlags.None)); AssertHelper.IsSameModel(offset, Path.Combine(_BasePath, $"SketchCorner_{corner}")); }
public void SketchOpenWire() { Sketch sketch = Sketch.Create(); SketchBuilder sb = new(sketch); sb.StartPath(-5, -5); sb.LineTo(-2, 0); sb.ArcTo(2, 0, 0, 2); sb.LineTo(5, -5); Body body = Body.Create(sketch); var offset = Offset.Create(sketch.Body, 0.5); Assert.IsFalse(offset.Make(Shape.MakeFlags.None)); Assert.That(Context.Current.MessageHandler.GetEntityMessages(offset).Any(msg => msg.Text.Contains("closed wires"))); }
public void SolidCompound() { var body = TestGeomGenerator.CreateBox().Body; var linearArray = LinearArray.Create(body); linearArray.Quantity1 = 2; linearArray.Quantity2 = 2; linearArray.Distance1 = 2; linearArray.Distance2 = 2; linearArray.DistanceMode1 = LinearArray.DistanceMode.Spacing; linearArray.DistanceMode2 = LinearArray.DistanceMode.Spacing; var offset = Offset.Create(body, 0.5); Assert.IsTrue(offset.Make(Shape.MakeFlags.None)); AssertHelper.IsSameModel(offset, Path.Combine(_BasePath, "SolidCompound")); }
public static Offset ConvertToOffsetFactor(string translation) { return(Offset.Create(translation.Trim())); }
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { var offsetValue = ((value as string) ?? string.Empty).Trim(); return(Offset.Create(offsetValue)); }