Pattern along a compound curve.

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Pattern along a compound curve.

Post by edwilliams16 »

@keshmaster81
Staying in Part Design can be done, but at least my solution involves attaching to faces and edges which makes it vulnerable to TNP if you change the model.

The idea here is you create the attachment curves on the torus by splitting the profile sketch for the revolution, as I did in an earlier post. We then want to attach sketches tangential to the surface at points on these curves to locate our holes. We do this in two steps.
  • Create a datum Point
  • Using MapMode, select the edge to attach it to, and use 'OnEdge"
Screenshot 2023-05-23 at 1.07.42 PM.png
Screenshot 2023-05-23 at 1.07.42 PM.png (35.71 KiB) Viewed 886 times
  • Make a sketch of your hole, centered at the origin, temporarily on the XY-plane.
  • Change this sketch's MapMode. First selection a surface of the revolution next to edge. Second selection the Datum Point. Mode: Tangent Plane
Screenshot 2023-05-23 at 1.08.27 PM.png
Screenshot 2023-05-23 at 1.08.27 PM.png (42.14 KiB) Viewed 886 times
You control the position of the Datum Point on the Curve with its Map Path parameter. It ranges from 0 to 1. (You might need to right-click and show all)
For the centered big holes, I set the MapPath to 0.5, pocketed and did polar arrays in both directions.
For the smaller holes, I offset the datum point from the center and did a Polar Array + Mirror MultiTransform.

In retrospect it would have been better to place the datum points and sketches before doing any pockets and transforms - then you shouldn't automatically get TNP when you change polar counts as the edge and face references wouldn't change.
Attachments
hydro_ew1.FCStd
(779.72 KiB) Downloaded 14 times
Screenshot 2023-05-23 at 1.16.58 PM.png
Screenshot 2023-05-23 at 1.16.58 PM.png (28.3 KiB) Viewed 886 times
keshmaster81
Posts: 42
Joined: Fri May 12, 2023 4:14 am

Re: Pattern along a compound curve.

Post by keshmaster81 »

@edwilliams16 Thank you so much for the help again. I've explored using the new method and while it is a big improvement, there are a couple of problems that I am unsure of how to solve.

Firstly, I should have mentioned this earlier but I am actually trying to CAD something that I have a physical model of, hence I need to be able to ideally take precise measurements with calipers or with a measuring tape.

My understanding of the map path parameter tool is that the values go from 0 to 1, where 0 is one endpoint of the arc and 1 is the other. My issue with this is that for placement of the smaller holes it would require me to know the arc length and how far into the arc the hole lies, which I am unsure of how I can practically measure, although I believe with some geometry and math stuff it can be achieved.

My next problem is for the larger set of 12 holes for which I have a similar problem as the small holes. The large holes are offset from the centre profile, with 6 occurrences on each side. Again I would need to know how far into the arc to go if I want to position the datum point appropriately, where it would be much easier to measure how much the datum point is offset from the centre profile.

Also I need my 12 holes to still remain evenly spaced, although offset from the centre, my problem is that by using a polar pattern and mirroring, along with the datum point, I end up with 12 holes and the centre two holes with a larger separation,
Screenshot 2023-05-28 at 7.37.51 PM.png
Screenshot 2023-05-28 at 7.37.51 PM.png (103.45 KiB) Viewed 733 times
which I can only seem to correct via trial and error by moving the datum points closer or farther.

I hope I was able to explain this properly, and thanks again.
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Pattern along a compound curve.

Post by edwilliams16 »

You can measure the arc-lengths on your model by selecting the arcs on the Revolution object - then send to python console (ctrl-shift-P) and query
sub.Length

Code: Select all

>>> doc = App.getDocument("hydro_ew1__1_")
>>> obj = doc.getObject("Revolution")
>>> shp = obj.Shape
>>> sub = obj.getSubObject("Edge8")
>>> ### End command Std_SendToPythonConsole
>>> sub.Length
1244.233286059719
>>> # Gui.Selection.clearSelection()
>>> # Gui.Selection.addSelection('hydro_ew1__1_','Body','Revolution.Edge11',-84.2782,-66.0809,-757.251)
>>> ### Begin command Std_SendToPythonConsole
>>> try:
>>>     del(doc,lnk,obj,shp,sub,subs)
>>> except Exception:
>>>     pass
>>> 
>>> doc = App.getDocument("hydro_ew1__1_")
>>> obj = doc.getObject("Revolution")
>>> shp = obj.Shape
>>> sub = obj.getSubObject("Edge11")
>>> ### End command Std_SendToPythonConsole
>>> sub.Length
1198.9589610208
so

dist_along_arc = map_path * sub.Length

angle along_arc = map_path * TotalAngle = map_path *90 degrees in my model.

To get the spacing from the missing hole, you set the map-path for the offset to get the desired angle.
Do it by hand calculation first, then use Expressions to automate it with variable parameters if desired.

You have to decide what measurements you can make to define the model. The rest is trigonometry.
keshmaster81
Posts: 42
Joined: Fri May 12, 2023 4:14 am

Re: Pattern along a compound curve.

Post by keshmaster81 »

I have been able to make some progress with the set of small holes and have decided on a way to take the measurements. I needed the exact positioning of the small holes on a different version of the pipe, so I tried to copy those features from the original version to the second model. I was able to get everything copied and fixed the dependencies except for the Datum Points. Everything on the second version renders, but I get an error since the Datum Points are not located inside the Body and I'm not sure how to fix this.
Hydro-104.FCStd
(983.92 KiB) Downloaded 11 times
keshmaster81
Posts: 42
Joined: Fri May 12, 2023 4:14 am

Re: Pattern along a compound curve.

Post by keshmaster81 »

I know I can manually measure the distance along the arc using a measuring tape, but I'm trying to think about a way that can lead to a more precise measurement, and if there is a mathematical trick or some trig I can do in order to get this using some easier known measurements from calipers. I've drawn a sketch for the problem and hoping to get some hints on how it can be done or if its not possible:
IMG_57685112336B-1.jpeg
IMG_57685112336B-1.jpeg (226.93 KiB) Viewed 512 times
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Pattern along a compound curve.

Post by edwilliams16 »

The datum points need to be inside the body. I recreated them with the body active, then edited the Support property of the sketches that depended on them to point to the new internal version of the Datum points.

When you upload revised files to the forum you should change their name...

EDIT added the file
Attachments
Hydro-104_EW1.FCStd
(908.23 KiB) Downloaded 9 times
Last edited by edwilliams16 on Mon May 29, 2023 11:10 pm, edited 1 time in total.
keshmaster81
Posts: 42
Joined: Fri May 12, 2023 4:14 am

Re: Pattern along a compound curve.

Post by keshmaster81 »

That worked thanks and sorry I'll fix that for next time.
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Pattern along a compound curve.

Post by edwilliams16 »

IMG_1452.jpeg
IMG_1452.jpeg (143.8 KiB) Viewed 458 times
This should give you the relations you need.
Post Reply