Fri, 10/22/2021 - 18:45
Hi,
I am working on a path display and am currently stuck on the implementation of Helix. I tried to understand MakeBottle.cxx from the occ-examples, but I had no chance. I understand too little about OCC to distinguish between Helix and the surfaces for the threading.
Fortunately, I discovered a post on cppblog that deals with Helix and OCC. I ran the Chinese through the translator, but somehow I'm still stuck.
So that a helix is a straight line on a cylinder surface is kind of clear. However, I don't understand all the steps to create the helix (from the blog).
The straight line "aLine2d" seems to be a vector. From the center axis of the cylinder to the shell surface with radius as one direction and cylinder axis as second direction. So far so good.
GCE2d_MakeSegment seems to be responsible for creating the helix. Could someone please help me understand what exactly the function does? Or point me to some background information? Maybe there is some prose to read? If possible written for dummies - i.e. without a PhD in math.
From the path library I use, I get three 3D space coordinates (start, end and center), the number of full turnarounds and the vector of the cylinder center axis.
I would like to understand GCE2d_MakeSegment to the extent that I can adapt the code to my needs.
Fri, 10/22/2021 - 23:25
Can this help - https://opencascade.blogspot.com/2015/08/arbitrary-law-based-curve-and-s... ?
Sat, 10/23/2021 - 11:39
Hi Roman,
thank you for your attention! I already found your blog before - so unfortunately no. I looked at
ShapeExtend_ComplexCurve
and tried to follow your code excerpts - but the more I ask auntie google, the more I felt lost in space.May be I'm too simpleminded for occ ...
So please let's go back to my starting point. helix creation from blog seems to be straight forward - although the sample is almoust senseless ...
I can only guess, what each function does. I suppose, that
GCE2d_MakeSegment()
creates a number of lines based on line-vector and value-range.BRepBuilderAPI_MakeEdge()
then wraps these lines around the cylindrical surface.I played with 3rd and 4th parameter - but did not get the point. When 3rd parameter is greater 0, than the helix starts at different height. So I guess, a positive value determines, how many segments from starting point are ignored.
4th parameter caused a lot of headache. First I thought (based on pi usage), that parameter would specify the angle of turnarounds. But this is not true. 2Pi does not lead to a (projected) full circle. Then I found out, that length of helix does depend on pitch value. So I thought, 4th parameter may lead to wirelength of helix, but that isn't true neither.
Is there a way to solve a helix this way? May be some of you could shine me a light or gimme a helping hand ...
actually I'm at this point:
I didn't find a way (yet) to create a
Geom_CylindricalSurface
fromTopoDS_Shape
. Then I guess, I have to apply some rotation and moves to the helixEdge to get the helix fit the points. How can I change the starting point of the helixEdge (in rotation sense respect to cylinders center)?Wed, 11/03/2021 - 22:06
At the first glance, this 2D segment is a parametric curve that lives in the UV space of a cylinder. Once mapped back to 3D, it becomes a helix. The magic here is this UV -> XYZ mapping. If you wish to elaborate on that matter, you can email me by sergey.slyadnev [at] gmail.com (I promise not to take your money :)
Sun, 10/24/2021 - 11:16
Hi,
I tried to use the code from your blog. Lots of changes where required to make it compilable. I always have a bad feeling, modifying code, I don't understand ... ... so it happens, what I expected: application crashes.
Exception: Standard not implemented at FirstParameter()
Although I don't understand, what's going on, I think a wrapper like a Handle-class should implement the entire public interface of the class it wraps. Or have a mechanism, that routes Handle-calls to the wrapped class. I don't see such mechanism, so I guess, I have to implement the public interface in the handle class.
Some help/comments would be very appreciated!
I attach the changed code, that does not work, but at least is compilable (with occ from git master).
Adding MakeHelix to Geom_HelixData is far from elegant, but at the moment I only care for getting it to work. I use the Helix stuff like this:
Sun, 10/24/2021 - 17:25
Hi,
I extended the handle class and it seems to work so far.
Creation of the helix is called like this:
makeHelix is a wrapper around the MakeHelix from blog like this:
I stil have a few questions, as the sample only works on trial and error.
where do I know from, whether the given angle is smaller or bigger than PI
where do I know from, whether I have to rotate the helix by angStart or angEnd and whether I have to use the original angle or its negative counterpart
Wed, 11/03/2021 - 17:46
@Roman
Would it be possible to get help by paid support?
If so, could you please contact me by email and send me a favorable offer?
Mon, 11/08/2021 - 11:29
Hello DjangoReinhard,
Information on official OCCT technical support can be found via the link.
For more details, please contact Open Cascade via the contact form.
Wed, 11/03/2021 - 20:28
@DjangoReinhard,
Hi,
Thank you for your interest but sorry, no bandwidth for any personal consulting while managing a company.
As a personal advice - refreshing your knowledge (or some learning) in computational geometry or math analysis should definitively help to figure the thing out. And folks at OCC will be happy to take your money.
Good luck!
Wed, 03/02/2022 - 14:58
Hi Here an an example of a helix as pcurve on a cylinder.
Helix on cylinder
Wed, 03/02/2022 - 11:42
@Guido, your link is broken - is it intentional?
Wed, 03/02/2022 - 14:28
@Krill, sorry. updated the link.