protected override void SolveInstance(IGH_DataAccess DA) { object raw_g = null; if (!DA.GetData("Glulam", ref raw_g)) { AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Invalid Glulam input."); return; } GH_Glulam ghg = raw_g as GH_Glulam; if (ghg == null) { AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Invalid Glulam input."); return; } Glulam g = ghg.Value; double offset = 0.0; DA.GetData("Amount", ref offset); DA.SetData("Output", g.ToBrep(offset)); }
protected override void SolveInstance(IGH_DataAccess DA) { object raw_in = null; if (!DA.GetData("Glulam", ref raw_in)) { AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "No Glulam specified."); return; } GH_Glulam ghg = raw_in as GH.GH_Glulam; if (ghg == null) { AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Input is not valid Glulam object."); return; } Glulam g = ghg.Value; int side = 0; DA.GetData("Side", ref side); double offset = 0.0; DA.GetData("Offset", ref offset); double width = 0.0; DA.GetData("Width", ref width); double extension = 0.0; DA.GetData("Extension", ref extension); Brep b = g.GetSideSurface(side, offset, width, extension); DA.SetData("Brep", b); }
protected override void SolveInstance(IGH_DataAccess DA) { object m_obj = null; Mesh m_mesh = null; bool m_faces = false; DA.GetData("Mesh", ref m_mesh); DA.GetData("Glulam", ref m_obj); DA.GetData("Faces", ref m_faces); Curve m_curve = null; while (true) { GH_Glulam m_ghglulam = m_obj as GH_Glulam; if (m_ghglulam != null) { m_curve = m_ghglulam.Value.Centreline; break; } GH_Curve m_ghcurve = m_obj as GH_Curve; if (m_ghcurve != null) { m_curve = m_ghcurve.Value; break; } Glulam m_glulam = m_obj as Glulam; if (m_glulam != null) { m_curve = m_glulam.Centreline; break; } m_curve = m_obj as Curve; if (m_curve != null) { break; } throw new Exception("Input must be either Glulam or Curve!"); } List <Vector3d> deviations = m_mesh.CalculateTangentVector(m_curve, m_faces); DA.SetDataList("Vectors", deviations); }
protected override void SolveInstance(IGH_DataAccess DA) { object m_obj = null; Mesh m_mesh = null; double m_angle = Rhino.RhinoMath.ToRadians(5); DA.GetData("Angle", ref m_angle); DA.GetData("Mesh", ref m_mesh); DA.GetData("Glulam", ref m_obj); while (true) { GH_Glulam m_ghglulam = m_obj as GH_Glulam; if (m_ghglulam != null) { m_mesh = m_ghglulam.Value.MapToCurveSpace(m_mesh); break; } GH_Curve m_ghcurve = m_obj as GH_Curve; if (m_ghcurve != null) { m_mesh = m_ghcurve.Value.MapToCurveSpace(m_mesh); break; } Glulam m_glulam = m_obj as Glulam; if (m_glulam != null) { m_mesh = m_glulam.MapToCurveSpace(m_mesh); break; } Curve m_curve = m_obj as Curve; if (m_curve != null) { m_mesh = m_curve.MapToCurveSpace(m_mesh); break; } throw new Exception("Input must be either Glulam or Curve!"); } var indices = m_mesh.CheckFibreCuttingAngle(m_angle); DA.SetDataList("Face Indices", indices); DA.SetData("debug", m_mesh); }