Changing Constraints Iteratively in Linear Pattern

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!
Hobbyist3927
Posts: 4
Joined: Thu Jul 22, 2021 6:38 pm

Changing Constraints Iteratively in Linear Pattern

Post by Hobbyist3927 »

Hello; I'm learning how to use FreeCAD for a project and ran into a little hiccup.

I want a linear pattern of these pockets down this bar.
pocket.PNG
pocket.PNG (3.38 KiB) Viewed 1025 times
I tried using the linear pattern tool; however, I am not sure it supports my use-case since I want the angle, 'A' shown in the following picture to be constrained to spreadsheet entries corresponding to which iteration of the pattern is being drawn.
pocketConstraints.PNG
pocketConstraints.PNG (47.93 KiB) Viewed 1025 times
After looking at another tutorial, I also tried using a linear transformation and polar transformation in a 'multi-pattern;' however, rather than polar transformations being applied iteratively to linear ones or vice versa when the pattern order are switched around, like with scaled transformations, it seems a polar pattern is produced with the complete result of the linear pattern. Furthermore, I am not sure that I could use a formula to properly regulate the polar pattern, since the GUI seems to take a formula for the extent of the pattern, but not a delta in the change per iteration stretched along said extent.

I could resort to manually copying the sketch and updating the formula for 'L' and 'A' from my picture to their corresponding entries on my spreadsheet; however, that seems like a poor solution.

Version Info
OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)


~*~*Edit 7/22/21 5:00PM*~*~

I have added an older copy of the object wherein I'd manually set the angles as an example; I have also included a picture of it. The angle of each subsequent slot in the picture below is slightly shallower. This is the effect I am hoping to recreate in an automated manner.
pocketWithAngles.PNG
pocketWithAngles.PNG (5.48 KiB) Viewed 1025 times
spreadsheet values.PNG
spreadsheet values.PNG (12.19 KiB) Viewed 1025 times
Attachments
chair-Part.step
(248.31 KiB) Downloaded 23 times
Last edited by Hobbyist3927 on Fri Jul 23, 2021 12:33 am, edited 3 times in total.
User avatar
Shalmeneser
Veteran
Posts: 9560
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Changing Constraints Iteratively in Linear Pattern

Post by Shalmeneser »

File ?
A visual description of the result would be useful.

Thank you
Last edited by Shalmeneser on Fri Jul 23, 2021 9:25 am, edited 1 time in total.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Changing Constraints Iteratively in Linear Pattern

Post by GeneFC »

Please post these small images directly into the message by using the attachment tab below the edit window. Much better than posting thumbnails and links.

[Edit: Images removed since they are now in the original.]

Gene
Hobbyist3927
Posts: 4
Joined: Thu Jul 22, 2021 6:38 pm

Re: Changing Constraints Iteratively in Linear Pattern

Post by Hobbyist3927 »

Thank you both for your replies; I have updated the post as advised.
User avatar
M4x
Veteran
Posts: 1483
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Changing Constraints Iteratively in Linear Pattern

Post by M4x »

I'm not at a computer right now but I think you could simplify the constraints in your sketch. Regarding your topic: I'd make only one Pocket and use LinearPattern in PartDesign afterwards. From my understanding, you've used this tool too. But I don't get why it's not working for you. Could you please explain it a little bit more in detail?
User avatar
Shalmeneser
Veteran
Posts: 9560
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Changing Constraints Iteratively in Linear Pattern

Post by Shalmeneser »

You need to program a macro to do a repetition reading position and orientation in a spreadsheet. :roll:
(check perhaps in macro Addon)
Hobbyist3927
Posts: 4
Joined: Thu Jul 22, 2021 6:38 pm

Re: Changing Constraints Iteratively in Linear Pattern

Post by Hobbyist3927 »

M4x wrote: Fri Jul 23, 2021 6:41 am I'm not at a computer right now but I think you could simplify the constraints in your sketch. Regarding your topic: I'd make only one Pocket and use LinearPattern in PartDesign afterwards. From my understanding, you've used this tool too. But I don't get why it's not working for you. Could you please explain it a little bit more in detail?
The linear pattern creates n copies of geometry between two points along their vector at intervals of their distance divided by n. I need each copy to be slightly rotated on its local axis. The rotation pattern does that, but again only at fixed intervals (and I need something which changes in intervals defined by a trigonometric function). It also seems like the rotated geometries cannot be spread out linearly.
Shalmeneser wrote: Fri Jul 23, 2021 9:29 am You need to program a macro to do a repetition reading position and orientation in a spreadsheet. :roll:
(check perhaps in macro Addon)
This looks like it will work. Thank you.
User avatar
M4x
Veteran
Posts: 1483
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Changing Constraints Iteratively in Linear Pattern

Post by M4x »

Ah, thanks, I didn't get that :oops:

May I ask what this is for?
Hobbyist3927
Posts: 4
Joined: Thu Jul 22, 2021 6:38 pm

Re: Changing Constraints Iteratively in Linear Pattern

Post by Hobbyist3927 »

M4x wrote: Fri Jul 23, 2021 6:41 am I think you could simplify the constraints in your sketch.
I am unsure rather I should make a new thread for this; however, I have attempted following this advice. Along the way, I actually noticed that the constraints are insufficient; I am not sure if this is a bug...

In this image, I label the parts of the pocket I am cutting out of the vertical bar.
labeled.PNG
labeled.PNG (53.93 KiB) Viewed 883 times
In this image, L is the distance from the top right hand corner of the vertical bar to the bottom of the slot where it coincides with the right side of the vertical bar; A is the angle between the bar and the slot I wish to cut out. H 1, 2, and 3 are constraints on a hole (for a bolt) which needs to be fixed relative to the slot. R 1, 2, and 3 are constraints for the slot.
outz.PNG
outz.PNG (52.34 KiB) Viewed 883 times
In this image, R 4, 5, and 6 are constraints for my slot, whereas H4 and H5 are constraints for the bolt hole.
inz.PNG
inz.PNG (28.28 KiB) Viewed 883 times
H
  1. Distance from point on the top edge of the slot to the front-top corner of the slot
  2. Distance from front-top corner of slot to the origin of the bolt hole
  3. Diameter of bolt hole
  4. The distance measured from the origin of the bolt hole to the point on the top of the slot is perpendicular to the top of the slot.
  5. There is a point on the top of the slot to measure the distance between it and the origin of the bolt hole.
R
  1. Angle between back and bottom sides of slot
  2. Slot width (applied to bottom points)
  3. Slot height (applied to back points)
  4. Top and bottom are equal
  5. Point coinciding with bottom of slot and the right edge of the vertical bar for constraining L
  6. Back and front are equal
The way in which Freecad ordinarily constraints rectangles is by making two sides horizontal and two vertical. This ensures that the rectangle is constrained, but does not allow it to rotate.

I am not sure how I may simplify my constraints, other than making R1 a 'perpendicular constraint;' however, I am noticing that this is not actually fully constrained. For example, the points at the front of the slot may freely switch position, moving further toward the back of the slot to keep the width consistent. In fact, when I put in other values for the angle and length, freeCAD does that for slots near the bottom of the bar.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Changing Constraints Iteratively in Linear Pattern

Post by chrisb »

If you want to pocket this, toggle the connecting line to the circle to a construction line - or remove it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply