algorithmic modeling for Rhino
Hi,
I am trying to display polyline geometry via C#.
just want to change the line thickness. Everything is good, when I look from "top view". But when I rotate the camera manually in Rhino Viewport, the displayed geometry is being cut from top and bottom.
How can I solve this issue? I attached image for explanation and grasshopper file.
For display I use following code:
private void RunScript(Point3d point, ref object A)
{
//Calling trail function to limit "pts" list.
trail();
//Incrementing point list
pts.Add(point);
//Adding points to polyline variable
pline.Clear();
pline.AddRange(pts.ToArray());
}
// <Custom additional code>
//Variables
List<Point3d> pts = new List<Point3d>();
Polyline pline = new Polyline();
int limit = 2550;
//Function to limit the size of points
public void trail(){
if(pts.Count > limit){
pts.RemoveAt(0);
}
}
//Display
public override void DrawViewportMeshes(IGH_PreviewArgs args) {
args.Display.DrawPolyline(pline, Color.Black, 8);
}
Tags:
You need to override the clipping box property and return a bounding box which contains all of your polyline geometry.
Thanks:) This seems to work
// <Custom additional code>
//Variable
BoundingBox _clippingBox;
//Override bounding box
public override void BeforeRunScript()
{
_clippingBox = BoundingBox.Empty;
}
public override BoundingBox ClippingBox
{
get { return _clippingBox; }
}
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by