Hello,
How do I set the point style of a Point Cloud being drawn in a Display Conduit?
I was hoping to assign a display mode description to the pointcloud but I realized since the point cloud is not being added to the document via .Add method it doesn’t have a GUID, is that correct?
// Method to assign a display mode to the point cloud
private void AssignDisplayModes(PointCloud pointCloud, DisplayModeDescription displayModeName)
{
// Get the object ID of the point cloud
var obj = Rhino.RhinoDoc.ActiveDoc.Objects.Find(pointCloud);
if (obj != null)
{
// Set the display mode for the point cloud object
obj.Attributes.SetDisplayModeOverride(displayModeName);
obj.CommitChanges(); // Apply changes to the object's attributes
}
}
This fails because pointCloud does not have an Id.
I was using the CloudDisplay component to visualize this point cloud in grasshopper which worked nicely but am now converting that grasshopper script to C#
Now that I am using a Csharp script I am using a Display Conduit to visualize the point cloud and that’s working fine except that the points of said cloud are drawn as solid squares and I want to set them to be drawn as solid circles.
I see display modes have a “Point Cloud Style” parameter but this doesn’t seem to effect a point cloud drawn in the Display Conduit? If it does I’m struggling on how to assign the display mode to said point cloud in the conduit.
DrawPointCloud appears to only take size and color arguments leading me to believe the display style is what will determine the “look” of the point cloud.
https://developer.rhino3d.com/api/rhinocommon/rhino.display.displaypipeline/drawpointcloud
Thank you so much for your help, I’m stumped!
EDIT:
Okay just realized there is a Display Pipeline attribute called Point Cloud Style:
I’m unsure how to assign the PointStyle to the point cloud points or my Draw methods in the conduit.
@dale @Gijs is there documentation on assigning PointStyle to a PointCloud?
Thank you!
EDIT 2:
My current point cloud displays as:
Where as the Grasshopper CloudDisplay component is using a different point style that I want to get closer to, I think it’s PointStyle.PointCloudStyle.RoundDot
or a variation of that, perhaps it’s actually a sprite?
You can see below I am setting the PointCloudStyle but this doesn’t seem to be working for the conduit as it visually still shows square and print statement says square as well.
// Override the DrawForeground to draw point clouds
protected override void DrawForeground(DrawEventArgs e)
{
if (majorPointCloud != null && majorPointCloud.Count > 0)
{
// Set the desired point cloud style
e.Display.DisplayPipelineAttributes.PointCloudStyle = PointStyle.SolidCircle; // Set to solid circle style
Rhino.RhinoApp.WriteLine($"DisplayPipeplineAttr: {e.Display.DisplayPipelineAttributes.PointCloudStyle}"); //This prints as PointStyle.Square still...
// Draw major points with size 5
e.Display.DrawPointCloud(majorPointCloud, 5);
}
if (minorPointCloud != null && minorPointCloud.Count > 0)
{
// Optionally set the point style for minor points as well
e.Display.DisplayPipelineAttributes.PointCloudStyle = PointStyle.SolidCircle; // Set to solid circle style
// Draw minor points with size 3
e.Display.DrawPointCloud(minorPointCloud, 3);
}
}
@stevebaer are you familiar with the DisplayConduit PointStyle methods and able to lean in here?
Thank you all!