public bool Cone(int index, ref Rhino.Geometry.Cone cone, ref Rhino.Geometry.Plane truncation) { Rhino.Geometry.Point3d origin = new Rhino.Geometry.Point3d(); Rhino.Geometry.Vector3d xaxis = new Rhino.Geometry.Vector3d(); Rhino.Geometry.Vector3d yaxis = new Rhino.Geometry.Vector3d(); double height = 0.0; double radius = 0.0; Rhino.Geometry.Point3d t_origin = new Rhino.Geometry.Point3d(); Rhino.Geometry.Vector3d t_xaxis = new Rhino.Geometry.Vector3d(); Rhino.Geometry.Vector3d t_yaxis = new Rhino.Geometry.Vector3d(); if (UnsafeNativeMethods.Rdk_CustomMeshes_Cone(ConstPointer(), index, ref origin, ref xaxis, ref yaxis, ref height, ref radius, ref t_origin, ref t_xaxis, ref t_yaxis)) { cone = new Rhino.Geometry.Cone(new Rhino.Geometry.Plane(origin, xaxis, yaxis), height, radius); truncation = new Rhino.Geometry.Plane(t_origin, t_xaxis, t_yaxis); return(true); } return(false); }
public void Add(Rhino.Geometry.Cone cone, Rhino.Geometry.Plane truncation, RenderMaterial material) { UnsafeNativeMethods.Rdk_CustomMeshes_AddCone(NonConstPointer(), cone.BasePoint, cone.Plane.XAxis, cone.Plane.YAxis, cone.Height, cone.Radius, truncation.Origin, truncation.XAxis, truncation.YAxis, material.ConstPointer()); }
public static Rhino.Commands.Result AddCone(Rhino.RhinoDoc doc) { Rhino.Geometry.Plane plane = Rhino.Geometry.Plane.WorldXY; const double height = 10; const double radius = 5; Rhino.Geometry.Cone cone = new Rhino.Geometry.Cone(plane, height, radius); if (cone.IsValid) { const bool cap_bottom = true; Rhino.Geometry.Brep cone_brep = cone.ToBrep(cap_bottom); if (cone_brep!=null) { doc.Objects.AddBrep(cone_brep); doc.Views.Redraw(); } } return Rhino.Commands.Result.Success; }
public static Rhino.Commands.Result AddCone(Rhino.RhinoDoc doc) { Rhino.Geometry.Plane plane = Rhino.Geometry.Plane.WorldXY; const double height = 10; const double radius = 5; Rhino.Geometry.Cone cone = new Rhino.Geometry.Cone(plane, height, radius); if (cone.IsValid) { const bool cap_bottom = true; Rhino.Geometry.Brep cone_brep = cone.ToBrep(cap_bottom); if (cone_brep != null) { doc.Objects.AddBrep(cone_brep); doc.Views.Redraw(); } } return(Rhino.Commands.Result.Success); }
public bool Cone(int index, ref Rhino.Geometry.Cone cone, ref Rhino.Geometry.Plane truncation) { Rhino.Geometry.Point3d origin = new Rhino.Geometry.Point3d(); Rhino.Geometry.Vector3d xaxis = new Rhino.Geometry.Vector3d(); Rhino.Geometry.Vector3d yaxis = new Rhino.Geometry.Vector3d(); double height = 0.0; double radius = 0.0; Rhino.Geometry.Point3d t_origin = new Rhino.Geometry.Point3d(); Rhino.Geometry.Vector3d t_xaxis = new Rhino.Geometry.Vector3d(); Rhino.Geometry.Vector3d t_yaxis = new Rhino.Geometry.Vector3d(); if (UnsafeNativeMethods.Rdk_CustomMeshes_Cone(ConstPointer(), index, ref origin, ref xaxis, ref yaxis, ref height, ref radius, ref t_origin, ref t_xaxis, ref t_yaxis)) { cone = new Rhino.Geometry.Cone(new Rhino.Geometry.Plane(origin, xaxis, yaxis), height, radius); truncation = new Rhino.Geometry.Plane(t_origin, t_xaxis, t_yaxis); return true; } return false; }