Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Techdraw] Implement arc length calculation for arbitrary edge(s) #11532

Merged
merged 2 commits into from Nov 26, 2023

Conversation

pavltom
Copy link
Contributor

@pavltom pavltom commented Nov 25, 2023

This pull request adds a new command to TechDraw's Extensions: Attributes toolset. As the title implies, it uses OCC functionality to find out the arc length of arbitrary edge or the sum of arc lengths of the selected edges. The resulting balloon holding the datum should look like a referencing dimension, including the formatting. The anchor (origin) of the ballon is placed in the point halving the calculated distance. If more edges are in the selection, please note the order of selecting does matter, so for best results try to select them in a continuous way.

This pull request also includes a fix for the arbitrary face area calculation, where non-unitary scale caused wrong balloon placement. Of course, this fix can be cherrypicked and merged independently.

I hope you will like the new feature, in case of any issues please let me know.

@github-actions github-actions bot added Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB TechDraw Related to the TechDraw Workbench labels Nov 25, 2023
@luzpaz
Copy link
Contributor

luzpaz commented Nov 26, 2023

@pavltom when you get a chance, a screencast would be most welcome 🙏

@WandererFan
Copy link
Contributor

the arc length code looks ok. Need a wiki entry for the new function.

Not really part of this PR, but note that the area annotation does not handle faces with holes correctly. This is because TD faces are only the outer perimeter with smaller faces stacked on top of larger faces. To get the correct value, we would have to get all the faces within the selected large face and do the appropriate OCC operations to generate a perforated face, then take the area.

@WandererFan WandererFan merged commit 84982fb into FreeCAD:main Nov 26, 2023
8 checks passed
@pavltom
Copy link
Contributor Author

pavltom commented Nov 27, 2023

@luzpaz I have tried to create a short video, it shows how to get the length of the sinusoid edge and then the length of short + long edges combined. Please note the placement point is a bit shifted to the left, because here lies the center of the combined curve.

TD_Arc_Length_command.webm

@WandererFan I will try to add the Wiki entry for the command tomorrow. As for the faces, You are right, it was an issue already with the transparent faces feature - the one fully enclosed by the another was a bit darker. Currently I am looking into the faces generation code, so hopefully we can somehow fix it one day. Now the only workaround is to subtract the area of the "small" face from the area of the "large" face.

@pavltom
Copy link
Contributor Author

pavltom commented Nov 27, 2023

So I have managed to grab some free time to create the Wiki entry. Please take a look at TechDraw ExtensionArcLengthAnnotation and feel free to make any additions or changes needed.

@pavltom pavltom deleted the techdraw_edge_arc_length branch December 7, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB TechDraw Related to the TechDraw Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants