PolarPattern with Z-axis shift depending on the function of angle

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: PolarPattern with Z-axis shift depending on the function of angle

Post by edwilliams16 »

Purely through the Gui, using Lattice2.
The key was to add a custom thetadeg property to a Part Cylinder and couple it to its Placement via expressions. Then make a Lattice2 paraseries in the thetadeg parameter.
Screen Shot 2022-11-30 at 8.48.19 AM.png
Screen Shot 2022-11-30 at 8.48.19 AM.png (48.99 KiB) Viewed 885 times
Attachments
wavyholes.FCStd
(232.67 KiB) Downloaded 15 times
drmacro
Veteran
Posts: 8862
Joined: Sun Mar 02, 2014 4:35 pm

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by drmacro »

Just a left field comment. The Nodes workbench can also do this quite nicely.
;)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by edwilliams16 »

Changing the technique slightly into a way that nicely generalizes to any situation where we want to populate a single-parameter family of placements with an object.
  • Create a custom Placement
  • Right-click in its data field and create a new float property.
  • Use expressions in the Placement fields to describe the location and orientation of the Placements as a function of your new parameter.
  • Select the Placement and then click Lattice2|Series Features|Paraseries.
  • In the paraseries properties create the parameter series using the generator, by listing values ,or by extracting from a spreadsheet
  • Set ParameterRef to Placment.yourParameterName Directly - not in the Expression Editor!
  • ParameterType is float
  • Turn on recomputes.
In the example, the parameter Name is Base_t, corresponding to angle. The angles are generated in - 20 values from 0 to 360 - not including 360.

The Parametric placement is:

You can populate the paraseries with objects, using Lattice2|Populate with copies.
Attachments
customplacementarray.FCStd
(15.67 KiB) Downloaded 14 times
Screen Shot 2022-11-30 at 10.45.04 AM.png
Screen Shot 2022-11-30 at 10.45.04 AM.png (18.46 KiB) Viewed 838 times
Screen Shot 2022-11-30 at 10.43.55 AM.png
Screen Shot 2022-11-30 at 10.43.55 AM.png (43.79 KiB) Viewed 838 times
Screen Shot 2022-11-30 at 10.39.53 AM.png
Screen Shot 2022-11-30 at 10.39.53 AM.png (33.29 KiB) Viewed 838 times
User avatar
JackkDBA
Posts: 60
Joined: Tue Jan 04, 2022 7:43 am
Location: Poland
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by JackkDBA »

Many thanks to all of you for help :)
I will learn Lattice2 workbench from the videos to understand what's going on.
Best regards,
Jacek
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by edwilliams16 »

Mangojelly has a good youtube series on Lattice2 but I’m not sure he specifically covers paraseries.

edit:
@JackkDBA
Lattice2's documentation is at https://github.com/DeepSOIC/Lattice2/wiki. Some examples in the forum: https://forum.freecadweb.org/viewtopic.php?f=3&t=67968 https://forum.freecadweb.org/viewtopic. ... 09#p610909
User avatar
JackkDBA
Posts: 60
Joined: Tue Jan 04, 2022 7:43 am
Location: Poland
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by JackkDBA »

edwilliams16 wrote: Wed Nov 30, 2022 8:51 pmIn the example, the parameter Name is Base_t, corresponding to angle.
I can't figure out where the Base_t parameter is defined and where is the "t" property came from:
Zaznaczenie_002.jpg
Zaznaczenie_002.jpg (77.91 KiB) Viewed 649 times
Best regards,
Jacek
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by edwilliams16 »

@JackkDBA
From right clicking in Custom’s data field and adding a new property.which you name t in the group Base.
User avatar
JackkDBA
Posts: 60
Joined: Tue Jan 04, 2022 7:43 am
Location: Poland
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by JackkDBA »

edwilliams16 wrote: Sun Dec 04, 2022 1:18 pm @JackkDBA
From right clicking in Custom’s data field and adding a new property.which you name t in the group Base.
Maybe I am clicking in wrong place but I don't see an option similar to "Add property" after right-click on Custom's data (empty field below "Placement Choice") :roll: :
no_add_property.png
no_add_property.png (130.25 KiB) Viewed 584 times
Best regards,
Jacek
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by edwilliams16 »

Right click, set "Show All'.
Right Click, 'Add Property'

I think I have 'Show All' as my default somewhere.
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: PolarPattern with Z-axis shift depending on the function of angle

Post by Vincent B »

Trying to do with ParametricCurve but can't give the right orientation right now. :roll:
Attachments
Special_polarpatern.FCStd
(20.91 KiB) Downloaded 14 times
CaptureA.JPG
CaptureA.JPG (23.87 KiB) Viewed 549 times
Post Reply