OS: Windows 10 (10.0) Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.19.17089 +1543 (Git) Build type: Release Branch: LinkStage3 Hash: 950c082111ae5ebeefb4dddc90a80dc9b54b2408 Python version: 3.6.8 Qt version: 5.12.1 Coin version: 4.0.0a OCC version: 7.3.0 Locale: English/United States (en_US)
This workflow is applicable for components that are simple and have a limited functional set of Connector nodes with dedicated meanings. Examples are screws, washers, nuts, a combustion engine block or a gearbox. Components may be complex and have many individual mating interfaces, but it might be worth the effort to declare and describe connectors, to make the component user's life easier.
This is also the workflow suited for beginners to become familar with the concept of Connectors.
To create an Assembly,…
To create Constraint Connectors,
To create an Assembly Constraint,
The alternative workflow in Assembly 3 is very similar, if not identical, to assembly workbenches that do not have the notion of Constraint Connectors or its equivalent. The component designer simply does not wrap the component in an assembly container, or omits the definition of Connectors. The component user creates them as needed, directly from geometry elements.
This workflow for creating constraints is well suited for components with a prohibitive number of potential mating interfaces, and/or where it is likely that only a few of them will be used by the component user. Example: A perforated plate — there are potentially hundreds of holes, but only a few will be used to mate with other components.
When a Constraint is created, Connectors and ConnectorLinks are created implicitly, often without being noticed. Therefore the workflow is not very well suited for beginners to learn the concept of Connectors.
The workflow goes as follows:
The necessary Connectors and ConnectorLinks are created implicitly, and bound to the geometry elements.
Enough theory, the next chapter is a hands-on tutorial. We will deepen the gained knowledge, and see how to get around some unexpected obstacles.
In this section we will create two simple components, show various ways to bind connectors to geometry, and mate them with an Assembly Constraint. Then we will break a connector with a design change, and show how to repair it without breaking the contraint.
It is recommended, but not mandatory, that a component developer wraps components with an Assembly container and explicitly declares Constraint Connectors for use by component users.
Wrap the Body with an Assembly:
The Body appears under the Parts node of the washer assembly.
Now we will define the Constraint Connectors of the washer component.
Two child nodes are created: Element and Element001. These are the Connectors that constraints can bind to. They are bound to the inner edges of the washer. If they are selected or if the mouse pointer hovers over them, they are highlighted in the 3D view.
Now we will provide a better identification for the connectors.
Depending on how you selected the edges in step 18, your connectors might have been assigned differently.
At this point, the washer component is finished. Some cleanup steps:
In this step we will define a simple block with a bunch of holes where we can attach the washers to.
To start here from scratch, …
The sketch should be fully constrained now.
You can name the datum constraints according to this image:
We will now wrap the body with an Assembly container:
Now we will define the Constraint Connectors of the block component.
Two child nodes are created: Element002 and Element003. These are the Constraint Connectors that constraints can bind to.
It is quite risky to bind a geometry element generated by a late feature such as this chamfer to a Constraint Connector. If an earlier Feature of the Body is modified, the edge names might disappear, or worse, might get a different meaning. We will investigate that and the implications later.
A better method is shown with the center hole:
Compared with the previous method, this Connector definition is more robust, because it was defined on an earlier Feature of the Body. However, there is still a better option:
The block component is finished with six constraint connectors where things like washers can be mated with. We will try that in the next step. But before, some cleanup steps:
Now is the time to get involved with Assembly Constraints.
It is necessary to have the model tree option Sync selection active to use this workflow. Click the menu View > Treeview actions, and make sure that the entry Sync selection is active.
To start here from scratch, …
Oh. The toolbar is inactive. Let's activate it!
Wait — the toolbar is already active! What's wrong here…?
The answer is simple if you know the answer: There is no Assembly container that can store the constraint. The container must contain the objects to be mated. So let's create one!
Continue:
To start here from scratch, …
The washer should have jumped to the bore hole. If not, …
Depending on the outside air temperature and the azimuth angle of the moon at a quarter to midnight, one of three things can happen:
If option three happend, save all your files, shut down the computer, go out, have a beer or two and be happy.
To be honest: That never has happened to me…
I'm not really sure what's the problem here, the error message does not really help out. I guess that the solver cannot decide in which direction to turn the washer so that the Connector planes become coplanar. So we will help a little bit and tilt the washer slightly:
It happened that the toolbar remained inactive on the first try. Just deselect everything and try again. Et voilá — the washer jumped to the expected position. In the wrong orientation, of course.
Anyway, …
Well, I'm not totally unhappy with the result, because now we can continue with…
That's the situation:
But let's see first what's happend in the Model Tree:
This carries us to another node with the same name, but with a different parent, named Elements002, which holds the Constraint Connectors of the project assembly container. It appears that all connectors that were used in a constraint are automatically published in the Constraint Connectors collection of the container assembly.
And indeed, that takes us to the Connector described as Washer Lower Inner Edge.
Let's hold and think for a minute. On the previous page, we have defined that a project assembly container has no public constraint connectors, because a project is not intended to be mated with other assemblies. Clearly, the nodes in the Constraint Connectors child list are internal connectors. So if we find a way to designate them as "internal", we are back on track. A suggestion:
Elements with no Description in the Constraint Connectors collection are considered "internal". A "public" or "external" connector has a non-blank description string.
So if we leave everything as is, the world is all right.
Just to be curious:
Note that the Connectors under the Plane Coincident constraint also changed their names!
To complete the documentation work, …
But now back to the problem: The washer is in the wrong orientation. We have three options to correct that:
Start with number three. Try the various angle properties. Nothing happens. Try the offset property. That works — but not an ideal solution.
Let's check number one.
This is the washer upper inner edge. Inspect the edge in the 3D window. This could be the one.
This rebinds the constraint to a different connector. Note that the washer jumped into the desired position, finally. Also note that the label changed, it is now prefixed with an underline character. A look into the constraint connectors list shows a new entry, named "_Washer Lower Inner Edge". This is misleading, because it is the upper inner edge:
With this last action the tutorial is finished. Some final cleanup steps, as always:
In this tutorial we have learned
In the next tutorial, we will try the second option, prepositioning the components to be mated to help the solver deliver the expected results.
In this small tutorial, we will try whether positioning components before mating them with constraints helps the solver to deliver better results. In the previous example we got the washer in the wrong orientation, so let's see if the strategy helps.
The washer jumped to the desired position, in the desired orientation. Q. e. d.
Now let's have a look at how the solver did the job.
It appears that the block remained in its initial position.
The washer was moved and rotated, but it could have been the other way round. If it is important that the block stays in its default position, select an arbitrary face and click the Lock Constraint toobar button before you mate the components.
Some final cleanup steps:
In this tutorial we will learn how to repair a broken connector.
Setting up the work file:
As you can see, the washer is mated to the bore hole chamfer on the upper face of the block. And one of the connectors involved is an outer chamfer edge. Let's see what happens if we delete the chamfer feature on the block body
The chamfers on the upper faces of the block disappear as expected. But another node in the tree unfolded and presents two nodes with an error icon:
When you hover the mouse pointer of the first defective node, an error message box appears and notifies that a geometry element from Body001.Chamfer, Edge12 could not be found. Not surprising, we just deleted that thing.
The next steps illustrate how these broken connectors can be repaired.
We will bind the upper edge of the pads to the connectors.
Now let's verify that the constraint is still intact.
The block dimension were updated immediately, and the washer followed to the new bore hole location. If not, …
Q. e. d.
As always, final cleanup steps:
In this tutorial we learned how to repair broken Constraint Connectors by rebinding them to another suitable geometry element.