Reference(Datum) Line through sketch circle center?

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!
wmayer
Founder
Posts: 20303
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Reference(Datum) Line through sketch circle center?

Post by wmayer »

garya wrote: Wed Oct 13, 2021 2:55 am Those discussions are from 2017 and 0.17. This seems like it invalidates the whole concept of a shape binder. Is that correct? I have shape binders which are (were?) working fine in 0.20 and were working in 0.18 and 0.19. Am I misunderstanding what you're saying?
No, a shape binder is there exactly for this purpose. But what's not allowed any more is that every other feature can directly link to an object of another body. And this makes sense to me because otherwise you have to implement the logic of a shape binder for nearly every feature type, too.
chrisb wrote: Wed Oct 13, 2021 4:03 am The issue here is a different one. It concerns only datum geometry. It is possible to add a ShapeBinder of a DatumLine or DatumPlane to another body.
These are correctly created as far as I can see ...
I was referring to this because I thought that was the actual question.
garya wrote:However, I cannot select a Datum line as external geometry in a sketch from another body.
About adding a shape binder of a datum line or plane I don't know how this was supposed to work. Whenever I try to create a shape binder (blue icon) I get an error dialog that the sub-shape type is not supported.

If I use the green icon then it immediately adds an object which indeed is invisible. IMO the problem here is that a datum line or plane always is an infinite geometry and the green sub-shape binder creates an infinite edge out of it. Now the point is that infinite shapes cannot be displayed.

You can easily see that it's infinite with:

Code: Select all

App.ActiveDocument.Binder.Shape.Edge1.ParameterRange # -> (-2e+100, 2e+100)
If you cheat a little bit you can make the sub-shape binder appear when you try to add an external geometry. Open the sketcher in edit mode and run this code snippet:

Code: Select all

c=App.ActiveDocument.Binder.Shape.Edge1.Curve
App.ActiveDocument.Binder.Shape = c.toShape(-10,10)
Now it will display a line that can be selected.

So, far this is not a bug because when displaying a shape we need its triangulation. However, for infinite shapes a triangulation doesn't exist.
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

In the original body where the datum line and plane were created, they are also infinite. However, in that body they are displayed. I'm guessing there is some magic being applied to make them finite? If you create a sketch in the first Body and create an external link to the line segment which is visible, you get a red line that extends out of the sketch on both sides, apparently infinite.
Shouldn't that finite thingy/magic be available, or reproducible, in the second object with the binders?
wmayer
Founder
Posts: 20303
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Reference(Datum) Line through sketch circle center?

Post by wmayer »

garya wrote: Thu Oct 14, 2021 2:58 am In the original body where the datum line and plane were created, they are also infinite. However, in that body they are displayed. I'm guessing there is some magic being applied to make them finite?
Not really. Lines and planes are two very simple geometries and we don't need a triangulation to display something. All what we need is to determine a few points (two for the line and four for the plane) so that we can create a visual representation.

Generic shapes can represent arbitrary geometries and a triangulation is needed at some point. So, to display an infinite shape it requires some extra effort. A finite parameter range must be applied to a shape so that a triangulation can be obtained and we have to make sure not to draw the boundary edges or points of them because they don't exist there.
Shouldn't that finite thingy/magic be available, or reproducible, in the second object with the binders?
Yes, for the binders we must make sure to display a segment of an infinite shape.
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

I kinda dropped the ball on this one, thought someone might reply.
wmayer wrote: Thu Oct 14, 2021 8:55 am
garya wrote: Thu Oct 14, 2021 2:58 am Shouldn't that finite thingy/magic be available, or reproducible, in the second object with the binders?
Yes, for the binders we must make sure to display a segment of an infinite shape.
So... should I file a bug because the shape binder is not available for selection in a sketch?
I'm asking because I ran into the same problem in another project.
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

I've reported this as issue issue #4774
wmayer
Founder
Posts: 20303
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Reference(Datum) Line through sketch circle center?

Post by wmayer »

Thanks for reporting.
wmayer
Founder
Posts: 20303
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Reference(Datum) Line through sketch circle center?

Post by wmayer »

git commit 9e8516002b9 now supports to display infinite shapes.

The parameter range is set to [-50, +50] for edges and [-50, +50]x[-50, +50] for faces.
garya
Posts: 412
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

Thank you!
Haven't rebuilt yet, but will check it out when I do.
Post Reply