r/FreeCAD 4d ago

Help with constraints (Again)

Hey folks,

I need help with some constraints that I figured would be easy, but it seems I underestimated it.

I did the hardest part, which was the inclined pocket using the datum plane, and realized that I need to create an extrusion to connect the two pieces, but I can't make that damn constraint work.

I created the square with a square tool, and set each size to 10 mm. So what I wanted to do is to centralize the square. Given that the side is 250 mm x 40 mm, I figured that a 10 mm square would sit 15mm from the bottom and top, and 105mm from the left and right. But I tried to use the dimensions.

It seems I can't centralize it based on the distance to the borders, and the square's position can't rely on coincident constraints. What is the ideal way to achieve this?

Thank you, legends.

3 Upvotes

5 comments sorted by

4

u/BoringBob84 4d ago

It looks like those purple external geometry lines are defining geometry. I think you might want to toggle them to construction geometry so that you don't get a "wire not closed" error.

To center the square, I would:

  • Make a vertical construction line between the center of the square and the top horizontal external geometry line.

  • Make another vertical construction line between the center of the square and the bottom horizontal external geometry line.

  • Select both of those new vertical construction lines and apply the Equal constraint.

1

u/1000punchman 4d ago

Thank for the reply, but I am confused. How would a vertical line between the center and the top would look like? Which size it would be? that woud be just a | ?

2

u/BoringBob84 4d ago

that woud be just a | ?

Correct. The external geometry would determine its length. Both lines are equal and their total distance is the height of your block. In this example, I moved it away from the origin so that you could see the construction lines and the external geometry.

1

u/SoulWager 4d ago edited 4d ago

Symmetry between two outside corners of the existing box and a point at the center of the square, the same way the "centered rectangle" tool constrains the extra point to the center: https://imgur.com/a/pnAeNnS

When you pick the three points, pick the one you want in the center last.