
Fri, 08/18/2017 - 10:17
Forums:
Hello everyone!
I need to make OCCT to draw lines with scalable thickness. Is there any standard methods in OpenCASCADE to do that ?
I know that it can be solved using geometry shader like this:
https://github.com/paulhoux/Cinder-Samples/tree/master/GeometryShader
Any ideas ?
Thanks.
Fri, 08/18/2017 - 12:05
Hi Anton,
if you want to change the thickness of a AIS_InteractiveObject representing a wire, you can use for example:
Handle(Prs3d_LineAspect) aspect =
new Prs3d_LineAspect(Quantity_NOC_VIOLETRED3,
Aspect_TypeOfLine::Aspect_TOL_SOLID, 4.0);
interactiveObject->Attributes()->SetWireAspect(aspect);
Benjamin
Mon, 08/21/2017 - 13:44
Thank you for the answer.
But it is not what I am looking for. When I am scaling the scene I want to see scaled lines.
So I think the best way to do this is to create a geometry shader. But I am stuck now with a simple thing:
It seems to me that shader program don't work. What am I doing wrong ?
Anyone ?
Tue, 08/22/2017 - 10:28
I have registered a bug for this issue:
https://tracker.dev.opencascade.org/view.php?id=29031
You can setup aspects manually instead of helper method Prs3d_Drawer::SetShaderProgram() to workaround bug in it.
Wed, 08/23/2017 - 06:12
Thank you for the answer!
I am already solved the problem - I set WireAspect manually. It works.
And I wonder why there is no geometry shader in OCCT yet. Because when I added it to OpenGL_ShaderProgram and to Graphic3d_TypeOfShaderObject it worked properly.
I hope that devs will add geometry shader to official release soon.
Wed, 08/23/2017 - 09:59
Graphic3d does not provide definition of Geometry Shader for a simple reason - there was no a use case for it yet.
Adding support for it should be quite straightforward though.
Contributions are welcome - Open CASCADE Technology is free and open source!
But you can at least register bugs / feature request on bugtracker, if you are using OCCT in your projects.
https://dev.opencascade.org/