random sketch placement.

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!
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

random sketch placement.

Post by freman »

Hi,

I am trying to attach a sketch to a body.

I selected an edge and a point and hit the icon for attaching a sketch. The selection severely restricted my options so I went for threePointPlane.

I assumed the endpoints of the line would provide two points and the vertex the third. Seems fine.

However, when I see the result , though I am in the plane I expected, there are seemingly random offsets that are not apparently related to any feature of the body or the axes or dimensions of the sketch.

Could someone explain the logic of what is happening here?

BTW I need to touch off on the face which is perpendicular to selected plane and place the holes 18.5mm from that face. That dimension is in the sketch, but because there is no common edge between these two planes this seems impossible. I tried adding a datum plane which I thought was the "trick" here but that was not acceptable as basis for attachment.

I need precise positioning so just poking around with the offsets until they seem to line up is not an option.

Any suggestions on how I can do this. This attachment business is as unintuitive as it could get.

TIA.

OS: Fedora 33 (Thirty Three) (LXQt//usr/share/xsessions/lxqt)
Word size of FreeCAD: 64-bit
Version: 0.20.24811 (Git)
Build type: Release
Branch: master
Hash: 2f276601f8615474c8290be3f9434c3401ff278f
Python version: 3.9.2
Qt version: 5.15.2
Coin version: 4.0.0a
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)
Attachments
random-sketch-posn.FCStd
(36.36 KiB) Downloaded 8 times
random.png
random.png (83.36 KiB) Viewed 490 times
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: random sketch placement.

Post by chrisb »

freman wrote: Fri Apr 30, 2021 7:31 pm Could someone explain the logic of what is happening here?
The origin of the attachment is the center of mass of the selected points. This is indeed in most (if not all) cases I have seen not what is needed. I would prefer to the first or the last of the selected points to be the center. That still is not always what is needed, but it's not worse than the center of mass, and often better.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: random sketch placement.

Post by freman »

The origin of the attachment is the center of mass of the selected points. This is indeed in most (if not all) cases I have seen not what is needed.
Many thanks for that explanation, Chris. I was wondering about something odd like that ( which is no use to a machinist, of course ).

First or last would at least allow some user control, however, when an edge is used it gives two points, so which is "first"?

Maybe an edge could be aligned with the x-axis and the point would set to lie on y. As long as it is defined and documented you then know how to design your sketch !

To provide a consistent scheme, if three points are given the first two could set x-axis, third sets y.

Any one of the end points would be better than c.of.m. :x At least that would relate to something physical you are trying to machine.

Just out of interest, what exactly on the sketch gets tied to this c.of.m. point, the origin of the sketch plane? How is orientation determined?
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: random sketch placement.

Post by freman »

So, bottom line, is there a way to place this sketch in a useful way ?
Bance
Veteran
Posts: 4190
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: random sketch placement.

Post by Bance »

freman wrote: Fri Apr 30, 2021 10:26 pm Just out of interest, what exactly on the sketch gets tied to this c.of.m. point, the origin of the sketch plane? How is orientation determined?
https://forum.freecadweb.org/viewtopic. ... 30#p477425
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: random sketch placement.

Post by freman »

thanks for the reminder. Re-reading the suite of that thread reminds me this problem of not seeing construction lines leaves simple sketches like this as a problem since the circles are just floating in space and there is no way to see the context to place them.

Apparently there is a feature request ...

Can you help with the second part of the question: How is orientation determined?

If you look at the screenshot I uploaded, the axis orientation is a bit crazy too.
Bance
Veteran
Posts: 4190
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: random sketch placement.

Post by Bance »

This question is like the last one, there has not been enough thought put into the initial model.

Solids not centred, sketches drawn from a million construction lines, and goodness knows what else. If 3D cad was easy it wouldn't matter, but it ain't, so it does.

I would probably select a point of the sketch(that pads to the solid), that co-responds to a corner of the plane the holes should reside on. Then scroll through modes until one looks kinda right, then sensibly redraw the sketch.
holes.png
holes.png (18.64 KiB) Viewed 411 times
Attachments
random-sketch-posn-1Bance.FCStd
(42.12 KiB) Downloaded 6 times
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: random sketch placement.

Post by chrisb »

I like having sketches with a sensible center of the coordinate system. But it is not an extremely big deal to use the one of the three defining ponts of the plane that I would have liked to be the center and use it for external geometry. However, things get complicated, if the sketch is turned in some weird way.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Bance
Veteran
Posts: 4190
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: random sketch placement.

Post by Bance »

The way attachment works, the origin of the attached sketch is key. I think much confusion is caused by the lack of a visible cue when selecting attachment mode, particularly with the OXY,OYX......methods. The simplest way would be to select a point and use translate then rotate in attachment offset.

When sketches are drawn before attachment even more confusion arises because they are often distance constrained to some notional edge/point that may not match the mode of attachment.

There is definitely room for UI improvement here. And also in the attachment modes themselves, but there needs to be much greater use to find out where the gains can be made.
User avatar
freman
Veteran
Posts: 2203
Joined: Tue Nov 27, 2018 10:30 pm

Re: random sketch placement.

Post by freman »

Solids not centred, sketches drawn from a million construction lines, and goodness knows what else.
I'm trying to use my CAD software to do CAD, sorry. I could have worked it all out on paper first and put the results into a simpler sketch ! My bad.


The x-block-outline-sketch has one circle and two rectangles as construction lines (not a million) . These elements represent two standard bearings which run on a ground cylindrical bar. That is the starting point mechanically and the centre line of the bar is the reference point for how this block relates to the rest of the machine. Other dimensions add further constraints which are required for the bearing block which is made by the pad operation. That is a minimal representation of geometry which allows FC to calculate the form of the block to be machined.

The UPN-Sketch then imports much of this geometry to integrate it with placement of other elements of the machine to ensure placement requirements work out. ie I'm importing the results of CAD solution provided by FC in the previous sketch. I could possibly read off certain values and hard code them into the second sketch but that would rather negate the point of parametric design software.

I found FC was quite helpful and did a good job. It's not "simple" because the job is not simple. It is not a trivial test geometry, it is a real world use of FreeCAD doing CAD.
There is definitely room for UI improvement here. And also in the attachment modes themselves, but there needs to be much greater use to find out where the gains can be made.
Which is exactly what I am providing by posting real world examples of the short comings of the UI. Due to relatively simple 45 degree geometry, was able to turn the sketch around X by hand and use a pocket calculator to work out the offsets, leaving Map Mode deactivated. That does not help me learn to use FC, nor does it provide feedback on where the gains can be had, which you are calling for.

It actually means that FC did a good job with the 2D CAD problem but was useless when it turned into a 3D problem and I had to work it out on paper and feed the results into FC. Luckily the 45 degree geometry was trivial and this was possible to do by hand.
I like having sketches with a sensible center of the coordinate system. But it is not an extremely big deal to use the one of the three defining ponts of the plane that I would have liked to be the center and use it for external geometry. However, things get complicated, if the sketch is turned in some weird way.
"Sensible" here seems to mean designing the sketches to work around the severely limited functionality of FreeCAD in the placement of sketches. That requires understanding the limitations of FC and reworking the representation of the mechanical design job to fit within those constraints. I'm in the process of learning those constraints. I'm posing questions here since it is also quite possible I'm missing how to do some steps or there is some old-hand, wizard who can provide me with a trick to get around the short-comings :)

There seems to be an amazing array of attachment options which fail to provide for a relatively simple case here.

I have two perpendicular planes ( which do not have a common edge in Body, since they are separated by another small rectangular plane ).
Ideally I would like to select one plane and get x-axis of the sketch to lie in that plane and a point or edge on the second plane to tie it down y axis mathematically. This option seems to be removed by the automatic reduction of the allowed choices, whereas I suspect the geometry would work if I was allowed.

IMO the whole centre of mass idea is totally useless in this context and should be replaced as a priority. It means the user has to apply arbitrary values to try to tweak the position in the UI which prevents accurate mechanical design. Either that, or he has to work out the same c.o.m. on paper to work out the required correction. It's an aberration which urgently needs fixing to make this at all useful.

It seems Chris is of a similar opinion on the usefulness of the current situation and that this is a recognised problem.
Post Reply