PDWrapper Macro ghostly update

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

PDWrapper Macro ghostly update

Post by TheMarkster »

Latest version 0.2021.10.15
In the spirit of Halloween I've added a new feature to adjust the placements of the tip base, tip tool, pattern base, and pattern tool shapes. It's a visual editor showing the shapes in different transparent colors, hence the ghostly reference.
Snip macro screenshot-e3444b.png
Snip macro screenshot-e3444b.png (73.33 KiB) Viewed 4253 times
This update, unfortunately, breaks existing models. Delete any existing objects before updating, and then rebuild them afterwards. Otherwise, you'll have a hard time deleting them. Should you neglect to delete before updating, just delete the pdwrapper.py file, restart, and delete the objects before running the macro again to rebuild the pdwrapper.py file. I shall endeavor not to break existing models with future updates.

*************
Update: 0.2021.10.14.rev8

Added enable/disable to context menu when right clicking in tree

*************

Update: latest version 0.2021.10.14.rev7

Fixed a bug in offset cutting. I renamed some properties and neglected to update some parts of the code. Hopefully all fixed now

****************

Macro_PDWrapper is now installable via the Addon Manager. Current version is 0.2021.10.14.rev6

Full documentation on github at:

https://github.com/mwganson/pdwrapper

There are also some example .FCStd files you download from there.

With PDWrapper you can:
  • Use non-Part Design objects inside Part Design bodies, including links
  • Dynamically enable/disable solid features in the Part Design tree
  • Transform Part Design features into other types: e.g. transform a threaded Hole into a threaded rod
  • Create a new type primitive in addition to Additive and Subtractive: Common (intersection) primitives, along with XOR types
  • 3D scaling of Part Design features or wrapped solids
  • 3D offsetting of solid features
  • 3D offset / scale and cut away the original, creating a Thickness without an open face.
  • Use objects in pattern features (e.g. polar patterns) that would not otherwise work with them
  • Make a linear pattern of a linear pattern without using multi-transform
  • Use Draft Arrays of solid objects in Part Design
  • Use Draft Arrays of sketches in Part Design Example
  • When PDWrapper object is the Body's Tip it can have multiple solids (generates warning)
  • Use Mesh objects directly in Part Design
In the screenshot below, I have used a Part Workbench fillet to create a variable fillet (something not supported with Part Design fillet) and encapsulated that fillet inside a PDWrapper Common Additive type.
pdwrapper_scr.png
pdwrapper_scr.png (82.45 KiB) Viewed 4487 times
There are a number of PDWrapper types available:
Snip macro screenshot-a884a6.png
Snip macro screenshot-a884a6.png (21.07 KiB) Viewed 4487 times
When wrapping a non-Part Design solid you have these choices of types of wrapper to use. Additive types will add the wrapped solid like you would have when using an additive primitive, such as an Additive Box. Subtractive types would be subtractive, and would cut away material rather than fuse with existing material, if any, already in the Body. The Common types add support for Common Primitives. When the wrapped solid is added using a Common Additive the effect is similar to using the Common boolean in Part workbench, it produces as the new tip shape the intersection of the new solid with existing material. XOR types perform an XOR boolean when being added. These almost always result in multiple solids, but I'm sure users will find creative ways to use these types, too.

The humble None type is not to be overlooked. The other types can all be used in pattern features, such as in a polar pattern, but the None types cannot be used in this manner. But what they can do is allow for the dynamic addition/exclusion of solid features. I'm including an example here where support is added to a tower structure, but only if the tower is above some prescribed height.

You should run the macro and create the file it offers to create before opening the example file. That way the class information will be imported and ready for use.

When the dd object's ddHeight property is less than ddMaxHeightWithoutSupport there is no support structure, but when it is more than that then the support structure is included. The Loft and the PolarPattern are still there either way and still must be valid and must be recomputed, but they are not part of the Body's tip shape. If you export the Body as a step file or as STL the support structure will not included if the height is below that threshold. In this example, the PDWrapper's Enabled property is bound via expressions to the dd object ddAddSupport property. Otherwise you could enable/disable by double clicking on the PDWrapper object in the tree.
Snip macro screenshot-04db0f.png
Snip macro screenshot-04db0f.png (61.3 KiB) Viewed 4487 times
Attachments
pdwrapper_dynamic_support_example.FCStd
(34.14 KiB) Downloaded 54 times
Last edited by TheMarkster on Sat Oct 16, 2021 1:45 am, edited 5 times in total.
freedman
Veteran
Posts: 3437
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: PDWrapper Macro

Post by freedman »

Can I install this without the addon manager? This is very cool, at first reading thru the list, wow!
Thanks
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: PDWrapper Macro

Post by TheMarkster »

Just put the .FCMacro file into your macro folder to install without the addon manager. I'm having trouble with it on windows with a warning it can't connect to the wiki, but in ubuntu (in a vm running on a windows host) it works. I don't know if the addon manager maybe is just timing out too fast or what.
Post Reply