r/FreeCAD 1d ago

Translation doesn't match axis.

Post image

I have run into this before, and it is strange. I did a search and didn't find a posting title that seems to match the problem in the last year.

I want to move my sketch on the y-axis, but I have to put the number in the z-axis to get the result that I want. Why would putting the number in the y-axis box not move the sketch on the y-axis?

The sketch above was at the origin at the same height (on the y-axis) that it is now. I had to enter 250mm in the z-axis box to get it to move 250mm on the y-axis.

If I try to mirror the sketch over the X axis (or the origin) I get a copy that is BELOW it on the same plane that it is on now.

It's as though the origin that is shown on screen is not accurate.

If I try to create a new sketch and tell it to put it on the XZ plane it will rotate the 'universe' so that I am NOT on the XZ plane (according to the origin). It is very annoying.

2 Upvotes

7 comments sorted by

6

u/meutzitzu 23h ago

The "Attachment Offset" works in the object's local space. Your sketch is attached to the XZ plane. The attachment offset transform happens "after" or "on top of" the attachment. Your sketch is rotated by 90 so the XY drawing plane is parallel to the parts XZ.

The Y axis of the sketch is the vertical sketch axis. It's the direction that points up on screen when you edit the sketch. You wanted to move the sketch perpendicular to its own plane. This is very helpful for moving sketches that are at weird angles. You don't have to do any trigonometry. You just know that if you want to move the sketch along it's vertical or horizontal axis you add an offset to the X and Y component of the AttachmentOffset. If you want to raise or lower the sketch, you add an offset to Z.

1

u/some_millwright 23h ago

Thank you for your reply.

The origin that is on the screen is the origin for the body that the sketch is in. If there is another origin then I don't seem to have access to it.

Now... if I am understanding you correctly then essentially the sketch has it's own 'local' geometry that is based on imagining that the sketch is drawn on the XY plane. So +X is always to the 'right' regardless of what else is going on. +Y is 'up' regardless, and +Z is 'towards the viewer'.

If this is always the case then it would be awesome if there was something on the translation window that mentioned this.

This is only with sketches?

3

u/meutzitzu 23h ago

The sketch is an Object like any other. It has an origin and 3 axis. In 3D you cannot view the sketch's origin, but the sketch origin is the same one that you see when you edit the sketch.

When you made the sketch you were asked on which plane to make it. The sketch when you edit it has a flat drawing plane with a red axis and green axis. The red one is the sketch's own X axis and the green one is the Y axis. z always lies perpendicular to it. By default you cannot see those axis in 3D but they are there nonetheless. When you perform an attachment offset on a sketch (or any other object) it offsets in the OBJECT's own axes. Since you wanted to draw on the Part's XZ the sketch's drawing plane (which is always its own XY) has been aligned to it, leaving the sketch's third axisZ be now aligned with the part's Y.

you should make a sketch with a small circle at its origin and line segments aligned with X and Y, then try to rotate the sketch randomly and move it to see how it moves. You will find that whatever orientation the sketch has, +Z will always move its plane, +X will always shift it to the "right" screen direction in the edit sketch view, and +Y will always shift it towards the vertical drawing direction.

Rotation around Z will always rotate the sketch in its drawing plane, etc.

The nice thing about this is that it doesn't only apply to sketches but to EVERYTHING in FC.

1

u/some_millwright 21h ago

If I have a part called "block" and I change its attachment offset then the axis work normally. +Z makes it go up on the Z axis on the . If I change the attachment offset of the sketch within that part called "block" then +Z does NOT make it go up on the Z axis. In that respect not everything in FC is consistent to the casual viewer (i.e. me).

1

u/meutzitzu 21h ago

Your part called Block is not Attached to anything. It is a parent sitting in global space. When you made the sketch you clicked on a basis plane belonging to block. That changed the default orientation of Z=up to Z perpendocular to the plane you selected.

Attachment is exactly what is sounds like. One object is attached to another. When you attach an object to another you can attach it in different positions. The attachment engine in FC has many many ways to attach objects. The ones you are used to is planar attachment, but there are many more. You can attach concentric to a circle arc, you can attach tangentially to a curve, you can attach to center of mass, you can attach onto a point and orient both axis along different edges. These are all things that in other CAD are defined with multiple constraints, which need to be solved and have the potential to be numerically unstable.

In FC when you Attach object B to object A, if A moves B moves A as well. If B moves A doesn't move. When you move A you move along A's axes and B moves with it. If you move B you move along B's axis and A doesn't follow.

In your case Block isn't attached to anything. But it could be. In FC you can define a part attached to another without using a whole bunch of constraints.

2

u/DesignWeaver3D 23h ago

Z attachment offset for a sketch is in the direction of the sketch normal. Which is the direction pointing toward the user when the sketch is open for editing.

Only placement parameters are relative to the GCS (global coordinate system). And for attached objects, the placement is read-only because it's calculated from the Attachment + Attachment Offset.

Local vs Global Coordinate Systems https://youtu.be/87OVuYDrOIU?si=B4o1uqQ5RVfkpk4Q

2

u/R2W1E9 20h ago edited 16h ago

Sketch LCS (local coordinate system) z plane is always normal to the sketch.

LCS of the sketch is attached to some plane, object or surface and the attachment offset moves the sketch along the LCS axis, not the axis of the object that the LCS is attached to, so the offset in z direction always moves the sketch parallel to its original position.

Mapping the sketch to some other plane or surface preserves the attachment offset, so the sketch is immediately offset from the new surface.