Reusing a pattern in multiple separate parts?

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!
kefir
Posts: 27
Joined: Wed Jul 23, 2014 9:03 pm

Reusing a pattern in multiple separate parts?

Postby kefir » Sat Feb 16, 2019 5:55 pm

Hi,

I've experienced a few situations where i feel the need for creating a reusable pattern to include in several part designs. For example, let's say I want to make some holes to screw two parts together. This is a fairly simple example, so I currently just design the same pattern of holes on each part. Fairly simple, but I still create the design multiple times.

Another example: let's say I'm designing train tracks for something like a BRIO train system. I might start with a sketch of the track profile that I could sweep/loft/pad/revolve to create curves, straight sections, hills, etc. I would also stick the same male and female connectors on each end of all of these. How should I make the profile and connector designs once, and then reuse them? And more importantly, how would I structure this so I could make an improvement/adjustment to the design, and make sure the change is represented in all the derivative parts? Is this possible?

I've read this , but I think any change would have to be replicated in all pars.

Thanks!
Last edited by kefir on Sat Feb 16, 2019 6:57 pm, edited 2 times in total.
Bance
Posts: 206
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Reusing a pattern in multiple separate parts?

Postby Bance » Sat Feb 16, 2019 6:42 pm

Use a master sketch workflow, you can create the sketch inside or outside of a body and then use carbon copy or shape-binders to bring the geometry to where its required.

HTH
Steve.
User avatar
bejant
Posts: 5631
Joined: Thu Jul 11, 2013 3:06 pm

Re: Reusing a pattern in multiple separate parts?

Postby bejant » Sat Feb 16, 2019 7:45 pm

kefir wrote:
Sat Feb 16, 2019 5:55 pm
I would also stick the same male and female connectors on each end of all of these. How should I make the profile and connector designs once, and then reuse them? And more importantly, how would I structure this so I could make an improvement/adjustment to the design, and make sure the change is represented in all the derivative parts?
Make Clones. If you change the original, the Clones will update too.
GeneFC
Posts: 1009
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Reusing a pattern in multiple separate parts?

Postby GeneFC » Sat Feb 16, 2019 8:52 pm

kefir wrote:
Sat Feb 16, 2019 5:55 pm
I've read this , but I think any change would have to be replicated in all pars.
That link is nearly five years old, and the FCStd files included were based on FC 0.14.xxxx.

Other than historical perspective ignore everything in that thread.

Gene
kefir
Posts: 27
Joined: Wed Jul 23, 2014 9:03 pm

Re: Reusing a pattern in multiple separate parts?

Postby kefir » Sun Feb 24, 2019 4:03 pm

Thanks people. I'm trying to use Clone, and I got it to work in the end - but I think I may be doing something wrong because this involved quite a few manual steps every time.

1. create a body with a single sketch (master sketch)
2. clone the sketch with Part Design Clone
3. select the clone, and add a new body - this way the clone is added into the body as a BaseFeature
4. create a new sketch in the same plane as the BaseFeature
5. add all edges of the sketch as linked external geometry
6. basically recreate the sketch, linked to the clone/basefeature

This new sketch that I've recreated can now be padded, revolved, or treated like the original sketch. And if I make changes to the original sketch, the parts created from the clones are updated. I can't seem to use the clone directly for anything much, so I have to recreate the sketch every time.

I'm attaching the test design I was playing with to get this working.

Is this the correct workflow? Or is there a simpler way to clone a sketch and use the clone for anything?
Attachments
mastersketchtest.FCStd
(33.08 KiB) Downloaded 11 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Reusing a pattern in multiple separate parts?

Postby NormandC » Sun Feb 24, 2019 5:33 pm

Actually, I don't think this is a correct use of a PartDesign Clone. The PD Clone was created to use external solids with PartDesign Boolean.

A BaseFeature by definition should only be a solid, that you were able to create a BaseFeature out of 2D geometry is in my opinion a bug in FreeCAD.

Here's what I think would be a correct work flow: create your master sketch outside of a Body, since you're not going to create 3D geometry inside this Body anyway (for that you need to create your new sketch from the Sketcher, not from PartDesign which automatically creates a Body). Then, make a Draft Clone of the sketch. Draft objects are 2D geometry, they can be dropped inside Bodies and be used for 3D features just like sketches.

You will notice that the tree is also much cleaner.
Attachments
mastersketchtest_normandc1.FCStd
(28.34 KiB) Downloaded 10 times
kefir
Posts: 27
Joined: Wed Jul 23, 2014 9:03 pm

Re: Reusing a pattern in multiple separate parts?

Postby kefir » Sun Feb 24, 2019 10:16 pm

Thanks, that was much easier. :)

It's not easy to understand the difference between stuff like Draft Clone and Part Design Clone. From a usability perspective, perhaps they can be consolidated into a single Clone function available from both workbenches? Could the "right" function be selected automatically, based on the input? Or if there are multiple possibilities, perhaps it could ask me which variant I want?
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Reusing a pattern in multiple separate parts?

Postby NormandC » Sun Feb 24, 2019 10:30 pm

There are two problems with merging those tools: they really don't have the same purpose, and they're in completely separate workbenches, each with its own design philosophy. One is programmed in a Python module (Draft), the other in C++.

You have to consider that FreeCAD is not a single CAD program, it's actually a collection of multiple ones that cater to very different needs. The Draft workbench has no idea what the PartDesign workbench is about, and vice versa. Making things smoother for the end user is always desirable, but at some point, to get the most out of the software, the end user has to learn how the software works, what are the differences between tools, what is the proper tool for a task. No amount of automation will cover that, not for such a complex program as FreeCAD. The alternative would be to restrict choices in the program (eliminate one tool out of the two), which would induce an undesirable reduction of features. FYI, a typical commercial CAD program requires a 32-hour training course just to get started on it.
kefir
Posts: 27
Joined: Wed Jul 23, 2014 9:03 pm

Re: Reusing a pattern in multiple separate parts?

Postby kefir » Mon Feb 25, 2019 5:23 pm

I see, thanks for the explanation.

I'm trying to design some toy train tracks as an example use of the master sketch, as I've learned so far. :) I've made the profile, which I can extrude/pad to the shape I like, but now I'm a bit stuck on the end connectors. I'm attaching the design I've made so far, and the measurements are taken from this website:

https://woodenrailway.info/track/brio-track-guide

Now, in the attached example, I've tried to make a track with id "E" as shown in the table on the above website, a basic bend/curve. The main part has worked fine, but now I'd like to try to connect the male and female end connectors to the main part. In the attached file I've sort of placed the connectors in approximately the place and padded them there. I didn't do the math, so it's visibly off it. I was hoping there was some way to snap the sketches on to the edge of the solid, so that they rotate and translate to the correct location. Then I could simply pad them there and keep everything parametric. Is this possible?

Screenshot from 2019-02-25 18-18-56.png
Screenshot from 2019-02-25 18-18-56.png (155.15 KiB) Viewed 155 times
Attachments
traintracks.FCStd
(68.26 KiB) Downloaded 5 times
User avatar
bejant
Posts: 5631
Joined: Thu Jul 11, 2013 3:06 pm

Re: Reusing a pattern in multiple separate parts?

Postby bejant » Mon Feb 25, 2019 8:04 pm

kefir wrote:
Mon Feb 25, 2019 5:23 pm
'd like to try to connect the male and female end connectors to the main part. In the attached file I've sort of placed the connectors in approximately the place and padded them there. I didn't do the math, so it's visibly off it. I was hoping there was some way to snap the sketches on to the edge of the solid, so that they rotate and translate to the correct location. Then I could simply pad them there and keep everything parametric. Is this possible?
Yes, it's possible, but I think you're over-complicating the design. Why not make the curved blank all in one Pad:
20190225a.png
20190225a.png (5.55 KiB) Viewed 138 times

20190225-track.FCStd
(19.54 KiB) Downloaded 5 times

and afterwards use another Sketch and Subtractive Sweep it to make the grooves?


OS: Ubuntu 18.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)