Edge on a surface
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Edge on a surface
Hey guys,
I was wondering if there is a built-in function that allows me to check if an edge lies on a surface.
Best Regards.
Osweldo
I was wondering if there is a built-in function that allows me to check if an edge lies on a surface.
Best Regards.
Osweldo
Re: Edge on a surface
Is that planar edge/surface or curved ones ?
Re: Edge on a surface
I haven't, I'm actually not acquainted with OpenCasCade API, but I'll search! Thank you!
Re: Edge on a surface
About the wording : you are mixing topology ("edge") with geometry ("surface")
You can check if an edge has a Curve2D representation on a face :
Code: Select all
aFace.curveOnSurface(anEdge)
But this is not a perfect test.
It may return nothing (if edge and face have no "historic" relation), although the edge may effectively lie on the face.
We're lacking some more information on the context.
Re: Edge on a surface
For clarification, do you want to know (a) if the edge is part of/belongs to a surface; that is if the edge is part of what defines the surface
or
(b) if the edge of, say, object1 contacts a surface of, say, object2?
Re: Edge on a surface
It was in fact what happened, it returned nothing, because the lines are projected on the surface.Chris_G wrote: ↑Tue Apr 20, 2021 10:14 amAbout the wording : you are mixing topology ("edge") with geometry ("surface")
You can check if an edge has a Curve2D representation on a face :will return a curve2D, and first / last parameters, or nothing.Code: Select all
aFace.curveOnSurface(anEdge)
But this is not a perfect test.
It may return nothing (if edge and face have no "historic" relation), although the edge may effectively lie on the face.
We're lacking some more information on the context.
I'll leave a picture so you can analyze.
- Attachments
-
- Sem Título.png (52.8 KiB) Viewed 885 times
Re: Edge on a surface
I want to know just if contacts, so (b)!
Re: Edge on a surface
I was pondering how I would do it manually. For a test I created a non solid cylinder and sketches of the same diameter. I then made a boolean common and checked the result with CheckGeometry.
I investigated the following cases:
- Sketch on surface: CheckGeometry is ok and shows a length for the resulting wire
- Sektch and surface are disjoint: CheckGeometry shows an invalid compound
- Sektch and surface are tangent: CheckGeometry shows an invalid compound
- Sektch and surface have two points in common: CheckGeometry shows an invalid compound, I expect the same result for one intersection point
So Boolean common could be a way for your check. However, seeing the now and then occurring coplanar issues I would not really guarantee for it.
I investigated the following cases:
- Sketch on surface: CheckGeometry is ok and shows a length for the resulting wire
- Sektch and surface are disjoint: CheckGeometry shows an invalid compound
- Sektch and surface are tangent: CheckGeometry shows an invalid compound
- Sektch and surface have two points in common: CheckGeometry shows an invalid compound, I expect the same result for one intersection point
So Boolean common could be a way for your check. However, seeing the now and then occurring coplanar issues I would not really guarantee for it.
- Attachments
-
- sketchOnSurface.FCStd
- (10.49 KiB) Downloaded 25 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.