Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

CustomGraphicsPointSet Colour property

markchristy
Explorer

CustomGraphicsPointSet Colour property

markchristy
Explorer
Explorer

Hi,

 

I've been experimenting with rendering some point data using the CustomGraphicsPointSet. In terms of geometry it's working fine, however I don't appear to be able to change the colour of the data to anything other than bright green. It's not 100% clear from the documentation whether you can change the colour property of PointSets but it appears to suggest you can.

 

Below is how I create my PointSet

Ptr<CustomGraphicsCoordinates> coordinates = CustomGraphicsCoordinates::create(points);
	coordinates->colors(colours);
	pointSet = cgGroup->addPointSet(coordinates, std::vector<int>(), CustomGraphicsPointTypes::PointCloudCustomGraphicsPointType, "");

 

And here is how I attempt to change the colour

Ptr<CustomGraphicsSolidColorEffect> solidRed = CustomGraphicsSolidColorEffect::create(Color::create(255, 0, 0, 255));
	//Ptr<CustomGraphicsVertexColorEffect> colorEffect = CustomGraphicsVertexColorEffect::create();
	bool result = pointSet->color(solidRed);

 

The result always appears to be "true", however the display always shows the PointSet as green.

 

Am I missing something or is this just a limitation of the SDK?

 

Thank you!

 

Mark

0 Likes
Reply
424 Views
6 Replies
Replies (6)

BrianEkins
Mentor
Mentor

For point graphics, it's best to use the user-defined type of point where you supply an image that represents the point. A user-defined point can be any color, shape, or size you want.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
1 Like

markchristy
Explorer
Explorer

Hi Brian,

 

Thank you for your comment. However, using an image surely I'm limited to all points in that set using the same image? Ergo they can not be different colours, etc.. 

 

For example I want to create like a "height map" or "heat map" of sample points (say 1,000 points) going from red through blue to green. It "should" be trivial to do this using the "PointCloudCustomGraphicsPointType" however it appears to ignore all colour information I supply.. unless of course I've done something wrong (which is entirely possible!).

 

Many Thanks

 

Mark

0 Likes

kandennti
Mentor
Mentor

Hi @markchristy .

 

I have also used small spheres in the past because point not reflect colors.
It is easy to create a sphere using the TemporaryBRepManager.createSphere method.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-D0EF2BCF-F477-4034-9121-5B51FFEB897D 

 

However, I have the impression that the processing of CustomGraphics is not very light, and I think that the processing becomes heavy if there is a large amount of them.

0 Likes

markchristy
Explorer
Explorer

Thank you @kandennti for the suggestion, however as you suggest it's not practical for many points to do this.

 

I guess I'm going to have to try some other "tricks" unless there is something obviously wrong with my code as to why I can't change the colour of PointSets?

 

Many Thanks

 

Mark

1 Like

kandennti
Mentor
Mentor

@markchristy .

 

If it were me, I would look for other methods once I know it is a bug.
It would be a waste to stop development just for that.

0 Likes

markchristy
Explorer
Explorer

@kandennti 

 

Well I've tried all sorts of tricks over the past few days. It appears the PointSet custom graphics type is pretty useless if you want to render something other than thumbnail images. Swapping to other approaches gets some results, but the performance and look is not going to be acceptable in the long run. So for now I think I just need to park this work and work on another platform sadly.

1 Like