Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate area of selected faces, if any.
- Loading branch information
1 parent
915f55a
commit 7f9117b
Showing
5 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -797,6 +797,23 @@ void SolveSpaceUI::MenuAnalyze(Command id) { | |
|
||
case Command::AREA: { | ||
Group *g = SK.GetGroup(SS.GW.activeGroup); | ||
SS.GW.GroupSelection(); | ||
auto const &gs = SS.GW.gs; | ||
double scale = SS.MmPerUnit(); | ||
|
||
if(gs.faces > 0) { | ||
std::vector<uint32_t> faces; | ||
faces.push_back(gs.face[0].v); | ||
if(gs.faces > 1) faces.push_back(gs.face[1].v); | ||
double area = g->displayMesh.CalculateSurfaceArea(faces); | ||
Message(_("The surface area of the selected faces is:\n\n" | ||
" %s\n\n" | ||
"Curves have been approximated as piecewise linear.\n" | ||
"This introduces error, typically of around 1%%."), | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
whitequark
Contributor
|
||
SS.MmToStringSI(area, /*dim=*/2).c_str()); | ||
break; | ||
} | ||
|
||
if(g->polyError.how != PolyError::GOOD) { | ||
Error(_("This group does not contain a correctly-formed " | ||
"2d closed area. It is open, not coplanar, or self-" | ||
|
1%%