From f18e3ba8238f9567cfce9318a60748222ec746ce Mon Sep 17 00:00:00 2001 From: Tom Svilans Date: Tue, 3 May 2022 22:59:47 +0200 Subject: [PATCH] fix(joints): added data for CIX export --- .../SpliceJoints/SpliceJoint_BlindTenon.cs | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/GluLamb/Joints/SpliceJoints/SpliceJoint_BlindTenon.cs b/GluLamb/Joints/SpliceJoints/SpliceJoint_BlindTenon.cs index ea82445..d18e66e 100644 --- a/GluLamb/Joints/SpliceJoints/SpliceJoint_BlindTenon.cs +++ b/GluLamb/Joints/SpliceJoints/SpliceJoint_BlindTenon.cs @@ -6,6 +6,7 @@ using Rhino.Geometry; using GluLamb.Factory; +using Rhino.Collections; namespace GluLamb.Joints { @@ -21,7 +22,7 @@ public class SpliceJoint_BlindTenon : SpliceJoint, IDowelJoint public static double DefaultDowelDrillDepth = 220; public static double DefaultDowelDiameter = 12; public static double DefaultDowelLengthExtra = 15; - public static double DefaultDowelSideTolerance = 1; + public static double DefaultDowelSideTolerance = 0.5; //public List debug; @@ -168,8 +169,8 @@ public override bool Construct(bool append = false) TenonWidth = Math.Min(Width, TenonWidth); TenonHeight = Math.Min(Height, TenonHeight); - var cutter = CreateTenon(0, ToleranceEnd); var cutterHole = CreateTenon(ToleranceSide, 0); + var cutter = CreateTenon(0, ToleranceEnd); FirstHalf.Geometry.Add(cutter); SecondHalf.Geometry.Add(cutterHole); @@ -177,9 +178,21 @@ public override bool Construct(bool append = false) FirstHalf.Element.UserDictionary.Set(string.Format("EndCut_{0}", SecondHalf.Element.Name), EndPlaneT); SecondHalf.Element.UserDictionary.Set(string.Format("EndCut_{0}", FirstHalf.Element.Name), FacePlane); + var tapAd = new ArchivableDictionary(); + tapAd.Set("EndPlane", EndPlane); + tapAd.Set("SlotPlane", FacePlane); + tapAd.Set("PlateFace0", new Plane(FacePlane.Origin + FacePlane.YAxis * TenonHeight / 2, FacePlane.ZAxis, FacePlane.XAxis)); + tapAd.Set("PlateFace1", new Plane(FacePlane.Origin - FacePlane.YAxis * TenonHeight / 2, FacePlane.ZAxis, FacePlane.XAxis)); + tapAd.Set("TenonSide0", new Plane(FacePlane.Origin + FacePlane.XAxis * TenonWidth / 2, FacePlane.ZAxis, FacePlane.YAxis)); + tapAd.Set("TenonSide1", new Plane(FacePlane.Origin - FacePlane.XAxis * TenonWidth / 2, FacePlane.ZAxis, FacePlane.YAxis)); + tapAd.Set("PlateThickness", TenonHeight); + tapAd.Set("Depth", Math.Abs(EndPlane.DistanceTo(FacePlane.Origin))); + + SecondHalf.Element.UserDictionary.Set(String.Format("TenonSlot_{0}", FirstHalf.Element.Name), tapAd); + // Create dowels var dowelPlane = new Plane(planes[0].Origin + planes[0].ZAxis * TenonLength * 0.5, planes[0].YAxis); - dowelPlane.Transform(Transform.Translation(dowelPlane.ZAxis * Width * 0.5)); + dowelPlane.Transform(Transform.Translation(-dowelPlane.ZAxis * Width * 0.5)); Dowels.Add(new Dowel(new Line(dowelPlane.Origin, dowelPlane.ZAxis * DowelLength), DowelDiameter)); @@ -201,11 +214,14 @@ public override bool Construct(bool append = false) FirstHalf.Geometry.Add(dowel.ToBrep(true, true)); SecondHalf.Geometry.Add(dowelTenon.ToBrep(true, true)); - FirstHalf.Element.UserDictionary.Set(string.Format("Dowel_{0}", SecondHalf.Element.Name), + //Parts[i].Element.UserDictionary.Set(String.Format("PlateDowel_{0}", Guid.NewGuid().ToString().Substring(0, 8)), new Line(dowelPlanes[i].Origin, dowelPlanes[i].ZAxis * DowelLength)); + + + FirstHalf.Element.UserDictionary.Set(string.Format("PlateDowel_{0}", SecondHalf.Element.Name), new Line(dowel.BasePlane.Origin + dowel.BasePlane.ZAxis * dowel.Height1, dowel.BasePlane.Origin + dowel.BasePlane.ZAxis * dowel.Height2)); - SecondHalf.Element.UserDictionary.Set(string.Format("Dowel_{0}", FirstHalf.Element.Name), + SecondHalf.Element.UserDictionary.Set(string.Format("PlateDowel_{0}", FirstHalf.Element.Name), new Line(dowelTenon.BasePlane.Origin + dowelTenon.BasePlane.ZAxis * dowelTenon.Height1, dowelTenon.BasePlane.Origin + dowelTenon.BasePlane.ZAxis * dowelTenon.Height2));