I suppose the same thing could be done with surfaces, but what about faces?
We used a modified ShapeCustom_BSplineRestriction, which wants a TopoDS_Shape, but can one make a TopoDS_Face with an adaptor?
True for surfaces - the blog post elaborates on that.
Not sure if I fully got the second part of the question, so let me offer two thoughts.
First, if you just need to represent a TopoDS_Face via an adaptor then you could use BRepAdaptor_Surface (which is an Adaptor3d_Surface subclass). Under the cover it effectively just uses the underlying Geom_Surface, so no real magic here.
Second, if you really want to modify the topology (e.g. solid), not just a single curve or surface then this would be closer to the so called 'space warping' - see enclosed images. That should also be possible with OCC. For that you would need to derive from BRepTools_Modification and redefine its virtual methods to implement warping.
Hope at least one of these corresponds to your inquiry. Please let me know otherwise.
Can the same approach in your blog be used for an arbitrary "equation-driven" curve? i.e. rather than having to create an adapter for each curve (helix etc.), have a single adapter which you supply parametric equation(s)?
The way you would design this is totally up to you. The only thing to provide is a subclass of Adaptor3d_Curve (or _Surface in a surface-related scenario). Whether you use multiple subsclasses (e.g. one for each curve type) or a single subclass with some evaluator inside is up to you. You just need to provide polymorphism - by redefining evaluation-related methods.
Fri, 08/18/2017 - 19:56
Hi Dan,
OCC does not have a helix as a natively supported type, so you have to approximate it with a B-Spline.
This post explains how you could do that - http://opencascade.blogspot.ru/2015/08/arbitrary-law-based-curve-and-sur....
Hope this helps. Good luck!
Roman
Mon, 08/21/2017 - 04:54
Thanks
Tue, 08/22/2017 - 10:52
Very interesting, Roman.
I suppose the same thing could be done with surfaces, but what about faces?
We used a modified ShapeCustom_BSplineRestriction, which wants a TopoDS_Shape, but can one make a TopoDS_Face with an adaptor?
Regards.
Mauro
Tue, 08/22/2017 - 12:00
Hi Mauro,
True for surfaces - the blog post elaborates on that.
Not sure if I fully got the second part of the question, so let me offer two thoughts.
First, if you just need to represent a TopoDS_Face via an adaptor then you could use BRepAdaptor_Surface (which is an Adaptor3d_Surface subclass). Under the cover it effectively just uses the underlying Geom_Surface, so no real magic here.
Second, if you really want to modify the topology (e.g. solid), not just a single curve or surface then this would be closer to the so called 'space warping' - see enclosed images. That should also be possible with OCC. For that you would need to derive from BRepTools_Modification and redefine its virtual methods to implement warping.
Hope at least one of these corresponds to your inquiry. Please let me know otherwise.
Best regards,
Roman
Sat, 09/02/2017 - 08:25
Use the PCurve of a surface it is easy to construct a helix curve, you can refer to:
https://github.com/eryar/occQt/wiki/Make-Helix-Shape-in-occQt
Mon, 09/04/2017 - 15:45
Hi Roman,
Can the same approach in your blog be used for an arbitrary "equation-driven" curve? i.e. rather than having to create an adapter for each curve (helix etc.), have a single adapter which you supply parametric equation(s)?
Thanks in advance.
Regards
Lincoln
Mon, 09/04/2017 - 18:22
Hi Lincoln,
The way you would design this is totally up to you. The only thing to provide is a subclass of Adaptor3d_Curve (or _Surface in a surface-related scenario). Whether you use multiple subsclasses (e.g. one for each curve type) or a single subclass with some evaluator inside is up to you. You just need to provide polymorphism - by redefining evaluation-related methods.
Hope this helps.
Roman
Wed, 09/06/2017 - 14:54
Hi Roman,
Thank you for your response. I will give it a try.
Regards
Lincoln