View: Shaded with Hard Edges

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
maxwxyz
Posts: 160
Joined: Sat Dec 31, 2022 2:42 pm
Location: Munich, Germany
Contact:

Re: View: Shaded with Hard Edges

Post by maxwxyz »

saso wrote: Sun May 07, 2023 9:22 am Check the improvements to the different draw styles in his build https://github.com/realthunder/FreeCAD/releases and their settings in Preferences -> Display -> Draw styles

See also this posts, to get an idea of what is already possible...
viewtopic.php?p=392670#p392670
viewtopic.php?p=394929#p394929
viewtopic.php?p=527574#p527574
viewtopic.php?p=462333#p462333
viewtopic.php?p=526770#p526770
Nice features but unfortunately these styles only apply to hidden lines, not smooth edges. @Pauvres_honteux is this something for you?
But similar to these hidden line styling options, I would prefer to add similar options for smooth vs. hard edges. I am not a developer, but how can I help achieve this?
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: View: Shaded with Hard Edges

Post by saso »

maxwxyz wrote: Sun May 07, 2023 10:00 am Nice features but unfortunately these styles only apply to hidden lines, not smooth edges...
Yes, I know that this is not exactly what you would like to have, but it is the way how to do it and as I said and as you can see, realthunder did a lot of work on this so he can probably give a good opinion about the additional functionality that you want...

I am wondering however how it can be done, because on the geometry level there are actually no such things as hard or smooth edges, this are all just faces and boundary edges between them (eg. fillet is also just a face). One way to do it, I guess, could be if two adjacent faces would be tangent to each other then the edge between them would not be displayed (would be hidden, but actually would have the same color as the face). If this would work it would actually be interesting because it would potentially also be the foundation for other possibilities like for example in the case of surface modeling to detect/analyse and display not just tangent but also G1, G2, G3 edges between faces... However it depends how fast this would work, specially on a larger model, since for the drawing styles we want then to be fast/realtime...

A different way would maybe for it to work on the Coin level, that is then using the mesh representation of the model instead of the brep geometry, so it then gives other, different possibilities to analyse and show different properties of shape of the mesh...
maxwxyz
Posts: 160
Joined: Sat Dec 31, 2022 2:42 pm
Location: Munich, Germany
Contact:

Re: View: Shaded with Hard Edges

Post by maxwxyz »

At least in TechDraw it is possible to set visibility in an isometric view for hard, smooth and seam edges (separate options for both, visible and hidden lines):
TechDraw_edge_visibility.jpg
TechDraw_edge_visibility.jpg (22.25 KiB) Viewed 1402 times
Not sure if the geometry is "calculated" differently in TechDraw.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: View: Shaded with Hard Edges

Post by adrianinsaval »

first would be interesting to know how we can detect said smooth edges without a big performance hit
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: View: Shaded with Hard Edges

Post by user1234 »

I know this also from CATIA, very useful.
adrianinsaval wrote: Tue May 09, 2023 7:04 pm first would be interesting to know how we can detect said smooth edges without a big performance hit
I guess while computing the result of the shape, the line, which probably has a boolean property tangent, gets accordingly its value. But i do not know

- if it is true
- if yes, if it is only a visual property or a shape property
- and if it is due an adjusted tangent angular tolerance (eg. 0.1deg) or calculated from its shape boundaries (kernel OCCT) exact


Greetings
user1234
maxwxyz
Posts: 160
Joined: Sat Dec 31, 2022 2:42 pm
Location: Munich, Germany
Contact:

Re: View: Shaded with Hard Edges

Post by maxwxyz »

adrianinsaval wrote: Tue May 09, 2023 7:04 pm first would be interesting to know how we can detect said smooth edges without a big performance hit
How is it done in TechDraw, is it that different?
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: View: Shaded with Hard Edges

Post by grd »

adrianinsaval wrote: Tue May 09, 2023 7:04 pm first would be interesting to know how we can detect said smooth edges without a big performance hit
Come on!
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: View: Shaded with Hard Edges

Post by chrisb »

grd wrote: Sun May 14, 2023 8:58 am Come on!
Premature hit the send button?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: View: Shaded with Hard Edges

Post by grd »

chrisb wrote: Sun May 14, 2023 12:32 pm Premature hit the send button?
No. I mean in (good old) Pro/Engineer there have always been 4 display modes: wireframe, hidden edges, and 2 shaded views: One with edges and one without, and this all works. Performance is never an issue. The only issue is maybe Coin3D. I am not OP but I would make a PR.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: View: Shaded with Hard Edges

Post by adrianinsaval »

grd wrote: Sun May 14, 2023 12:53 pm No. I mean in (good old) Pro/Engineer there have always been 4 display modes: wireframe, hidden edges, and 2 shaded views: One with edges and one without, and this all works. Performance is never an issue. The only issue is maybe Coin3D. I am not OP but I would make a PR.
I thought this would be obvious but proprietary CADs don't use occt or coin, there's several things where occt and/or coin are just not as performant as most proprietary products so performance is something we do have to take into account. Of course, nobody's stopping anyone from making a PR, if you know how to make this work go ahead and propose it...
Post Reply