forked from 1b-agent/opencadstudio-upstream
Merge pull request #991 from gianlucafiore/feat/measure-ribbon-dropdown
feat(ribbon): add measurement dropdown
This commit is contained in:
5 files changed
+172
-2
No files matched your search
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="139.55254mm"
|
||||
height="143.60846mm"
|
||||
viewBox="0 0 139.55254 143.60846"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
xml:space="preserve"
|
||||
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
|
||||
sodipodi:docname="Area.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="1.0456808"
|
||||
inkscape:cx="229.9937"
|
||||
inkscape:cy="211.34557"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1010"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1"
|
||||
showguides="true"><sodipodi:guide
|
||||
position="30.779904,118.56026"
|
||||
orientation="0,-1"
|
||||
id="guide1"
|
||||
inkscape:locked="false" /><sodipodi:guide
|
||||
position="19.402411,113.83349"
|
||||
orientation="1,0"
|
||||
id="guide2"
|
||||
inkscape:locked="false" /></sodipodi:namedview><defs
|
||||
id="defs1"><pattern
|
||||
inkscape:collect="always"
|
||||
xlink:href="#Strips1_2"
|
||||
preserveAspectRatio="xMidYMid"
|
||||
id="pattern4"
|
||||
patternTransform="matrix(4.9363448,2.85,-2.85,4.9363448,0,0)"
|
||||
x="0"
|
||||
y="0" /><pattern
|
||||
inkscape:collect="always"
|
||||
patternUnits="userSpaceOnUse"
|
||||
width="3"
|
||||
height="1"
|
||||
patternTransform="translate(0,0) scale(2,2)"
|
||||
preserveAspectRatio="xMidYMid"
|
||||
id="Strips1_2"
|
||||
style="fill:#b4b6b9"
|
||||
inkscape:stockid="Stripes 03 (1:2)"
|
||||
inkscape:isstock="true"
|
||||
inkscape:label="Rayas 03 (1:2)">
|
||||
<rect
|
||||
style="stroke:none"
|
||||
x="0"
|
||||
y="-0.5"
|
||||
width="1"
|
||||
height="2"
|
||||
id="rect146" />
|
||||
</pattern><rect
|
||||
x="377.02711"
|
||||
y="198.43532"
|
||||
width="69.093744"
|
||||
height="42.077851"
|
||||
id="rect3" /><rect
|
||||
x="361.48699"
|
||||
y="218.03977"
|
||||
width="143.44722"
|
||||
height="101.36937"
|
||||
id="rect2" /></defs><g
|
||||
inkscape:label="Capa 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"><path
|
||||
style="opacity:1;fill:url(#pattern4);stroke:#6db7ed;stroke-width:9.3;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:6.2;stroke-dasharray:9.3, 18.6;stroke-dashoffset:696.57;stroke-opacity:1;paint-order:stroke markers fill"
|
||||
d="m 81.048794,13.662079 c -0.04886,3.271015 0,42.581917 0,42.581917 H 60.731929 V 109.56087 H 12.782532 V 68.768092 L 12.641761,39.783756 V 13.662069 l 68.407033,10e-6"
|
||||
id="path1"
|
||||
sodipodi:nodetypes="ccccccccc" /><path
|
||||
style="fill:none;stroke:#6db7ed;stroke-width:9.3;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:6.2;stroke-dasharray:9.3, 18.6;stroke-dashoffset:696.57;stroke-opacity:1;paint-order:stroke markers fill"
|
||||
d="m 81.048794,13.662079 c -0.0489,3.271015 0,42.581917 0,42.581917 H 60.731924 V 109.56087 H 12.782531 V 68.768092 L 12.64176,39.783756 V 13.662069 l 68.407034,10e-6"
|
||||
id="path1-2"
|
||||
sodipodi:nodetypes="ccccccccc" /><text
|
||||
xml:space="preserve"
|
||||
transform="matrix(3.3801946,0,0,3.3801946,-1151.7357,-693.95457)"
|
||||
id="text2"
|
||||
style="font-weight:600;font-size:21.3333px;line-height:1.25;font-family:Montserrat;-inkscape-font-specification:'Montserrat Semi-Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect2);display:inline;opacity:1;fill:#6db7ed;fill-opacity:1;stroke:none;stroke-width:17.0079;stroke-linecap:square;stroke-miterlimit:6.2;stroke-dasharray:17.0079, 34.0157;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"><tspan
|
||||
x="361.48633"
|
||||
y="237.64636"
|
||||
id="tspan3">χ</tspan></text><text
|
||||
xml:space="preserve"
|
||||
transform="matrix(1.8228531,0,0,1.8228531,-575.02769,-328.48691)"
|
||||
id="text3"
|
||||
style="font-weight:600;font-size:21.3333px;line-height:1.25;font-family:Montserrat;-inkscape-font-specification:'Montserrat Semi-Bold';letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect3);display:inline;opacity:1;fill:#6db7ed;fill-opacity:1;stroke:none;stroke-width:17.0079;stroke-linecap:square;stroke-miterlimit:6.2;stroke-dasharray:17.0079, 34.0157;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"><tspan
|
||||
x="377.02734"
|
||||
y="218.04284"
|
||||
id="tspan4">2</tspan></text></g></svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="139.55254mm"
|
||||
height="143.60846mm"
|
||||
viewBox="0 0 139.55254 143.60846"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
xml:space="preserve"
|
||||
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
|
||||
sodipodi:docname="cinta metrica.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="0.73940797"
|
||||
inkscape:cx="148.09145"
|
||||
inkscape:cy="319.17427"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1010"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" /><defs
|
||||
id="defs1" /><g
|
||||
inkscape:label="Capa 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"><path
|
||||
style="fill:#b4b6b9;stroke-width:0.516173;fill-opacity:1"
|
||||
d="m 122.88669,143.40304 c -1.9211,-0.63714 -3.2045,-2.14064 -3.5311,-4.13671 -0.0784,-0.47916 -0.18033,-1.90542 -0.22651,-3.16945 l -0.084,-2.29824 -2.81883,-1.87076 c -11.01934,-7.31317 -24.295889,-15.49579 -40.328559,-24.85535 -2.97859,-1.73884 -5.47989,-3.16152 -5.55845,-3.16152 -0.0786,0 -3.38775,1.60287 -7.35376,3.56194 -6.12636,3.02621 -7.27789,3.55126 -7.65615,3.49092 -0.28102,-0.0448 -2.20803,-1.27039 -5.22482,-3.32295 -2.62878,-1.78855 -6.01207,-4.08979 -7.51843,-5.11386 -1.50636,-1.02407 -2.87875,-1.99338 -3.04976,-2.15404 -0.19093,-0.17937 -0.74699,-1.442332 -1.44086,-3.272572 l -1.12993,-2.98047 -14.14083,-8.9977 c -9.91657,-6.30983 -14.2125896,-9.1157 -14.3810596,-9.39272 -0.13213,-0.21728 -0.55891,-1.36556 -0.94841,-2.55175 -0.7982,-2.43084 -0.80279,-2.66927 -0.0664,-3.44996 0.97935,-1.0383 1.32486,-2.26588 1.03318,-3.67089 -0.095,-0.4574 -0.81981,-2.09971 -1.80588,-4.09162 -3.11855,-6.29964 -4.47778,-9.74343 -5.49639,-13.92577 -1.75151,-7.19166 -1.53009,-13.20201 0.73909,-20.0619 2.50011,-7.55797 5.90972,-13.14678 9.6418996,-15.80432 0.82996,-0.59098 12.4163,-6.2762805 17.67083,-8.6708805 6.56812,-2.99323999 8.97414,-3.62292999 13.31565,-3.48486999 1.74217,0.0554 2.45433,0.13997 3.51311,0.41721 2.57034,0.67303999 4.7062,2.10568999 5.97394,4.00706999 0.99544,1.493 1.35814,1.67022 3.43461,1.6783 1.81805,0.007 1.4893,-0.15216 3.80793,1.84445 3.0954,2.6655205 6.71339,6.0031905 8.53636,7.8749605 1.50129,1.54149 2.00521,2.15602 2.34433,2.85892 0.53514,1.1092 0.82611,2.1163 0.94479,3.27005 0.0897,0.87238 0.10819,0.9054 1.06861,1.91199 5.17504,5.4238 9.06393,13.22709 10.10726,20.28075 0.3315,2.24113 1.06653,14.64829 1.39064,23.47343 l 0.0947,2.5781 0.76236,1.30899 c 0.68379,1.17409 0.76659,1.40102 0.80339,2.20188 0.0226,0.49108 0.16102,4.26884 0.30767,8.39501 0.14666,4.12617 0.31384,7.54254 0.37152,7.59194 0.0577,0.0494 2.87042,1.70736 6.25055,3.68435 16.715159,9.776492 32.420709,19.141512 42.724569,25.476122 3.16541,1.94603 4.26431,2.6901 4.42369,2.99529 0.18654,0.35721 0.20037,1.09652 0.11493,6.14569 -0.054,3.19134 -0.16151,6.01247 -0.24214,6.35419 -0.21119,0.89504 -0.85353,1.95942 -1.55524,2.57709 -0.5565,0.48985 -10.16024,5.83451 -11.45728,6.37619 -0.83422,0.34839 -2.44168,0.38832 -3.36084,0.0835 z m 7.31897,-5.88512 c 2.77922,-1.52044 5.16696,-2.86678 5.3061,-2.99186 0.53737,-0.48307 0.59569,-0.83928 0.6914,-4.22276 0.0515,-1.82151 0.0634,-3.31183 0.0265,-3.31183 -0.037,0 -0.42418,0.31262 -0.86046,0.69472 -2.98898,2.61781 -7.52578,4.85229 -12.04114,5.93055 l -1.00511,0.24002 0.0949,2.47404 c 0.10654,2.77594 0.2251,3.20836 1.02756,3.74768 0.89541,0.60179 1.16971,0.4979 6.76025,-2.56056 z m -3.97098,-0.59102 c -0.6227,-0.57065 -0.75254,-1.32257 -0.34155,-1.97793 0.40026,-0.63826 6.27727,-3.58724 7.14899,-3.58724 0.99604,0 1.7078,0.79795 1.55449,1.74272 -0.14447,0.89027 -0.37541,1.05734 -3.72167,2.69244 -3.63178,1.77461 -3.87283,1.83331 -4.64026,1.13001 z m -3.3119,-6.60151 c 4.70289,-1.33815 8.6453,-3.36886 11.19276,-5.76533 1.53457,-1.44361 1.52422,-1.39343 0.43009,-2.08444 l -0.9154,-0.57812 -5.26312,0.50919 c -4.85513,0.46973 -5.279,0.53118 -5.46798,0.79263 -0.28415,0.39313 -3.83538,6.69631 -3.79138,6.72942 0.0196,0.0148 0.3702,0.24925 0.77904,0.52106 0.83514,0.5552 0.61592,0.56419 3.03599,-0.12441 z m -4.21249,-6.39926 c 1.58125,-2.80833 2.16903,-3.73549 2.48171,-3.91462 0.30088,-0.17237 1.26216,-0.3139 3.61912,-0.53284 1.76518,-0.16396 3.39049,-0.34133 3.6118,-0.39414 0.373,-0.089 0.15041,-0.24884 -3.04879,-2.18916 -1.89816,-1.15123 -3.49543,-2.0393 -3.5495,-1.97349 -0.0541,0.0658 -0.45179,0.59107 -0.8838,1.16726 -0.98721,1.31665 -3.13197,3.37991 -4.46554,4.29586 -1.49067,1.02383 -3.54618,2.12467 -5.22013,2.79565 -1.13372,0.45443 -1.43015,0.62473 -1.29743,0.74534 0.0946,0.086 1.40117,0.94538 2.90345,1.90979 1.50228,0.9644 2.88464,1.87002 3.07191,2.01249 0.43114,0.32799 0.20173,0.65197 2.7772,-3.92214 z m -10.95822,-2.94757 c 4.69357,-1.44838 8.44534,-3.88887 10.69819,-6.95908 l 0.64974,-0.88547 -0.31083,-0.20709 c -0.17096,-0.11391 -2.12397,-1.28773 -4.34003,-2.6085 l -4.02919,-2.4014 -0.77373,1.0357 c -2.41549,3.23333 -5.60212,5.5933 -9.895829,7.32869 -0.60091,0.24286 -1.07983,0.48233 -1.06428,0.53214 0.0155,0.0498 1.336889,0.90281 2.936279,1.89556 1.59939,0.99275 3.24599,2.0288 3.65911,2.30235 0.41313,0.27355 0.81851,0.47664 0.90085,0.45132 0.0823,-0.0253 0.78872,-0.24322 1.56972,-0.48422 z m -10.918579,-7.10952 c 2.0762,-0.68633 4.430819,-1.79219 5.903619,-2.77266 1.42345,-0.94763 3.29692,-2.70206 4.17597,-3.91065 l 0.68808,-0.94603 -2.01339,-1.18537 c -1.10737,-0.65194 -2.97382,-1.75179 -4.14767,-2.44411 l -2.134259,-1.25875 -0.73372,1.03976 c -0.98714,1.3989 -3.05498,3.43316 -4.63198,4.55676 -1.23461,0.87966 -3.87382,2.30854 -5.44412,2.94748 -0.40614,0.16526 -0.70303,0.33585 -0.65978,0.37911 0.25378,0.25378 6.90036,4.14556 7.08526,4.14864 0.12333,0.002 0.98372,-0.24733 1.91199,-0.55418 z m -9.8525,-6.88518 c 3.68766,-1.40726 6.66191,-3.51515 8.68281,-6.15362 0.67126,-0.876382 0.Line truncated
|
||||
id="path1" /><path
|
||||
d="m 122.88669,143.40304 c -1.9211,-0.63714 -3.2045,-2.14064 -3.5311,-4.13671 -0.0784,-0.47916 -0.18033,-1.90542 -0.22651,-3.16945 l -0.084,-2.29824 -2.81883,-1.87076 c -11.01934,-7.31317 -24.295889,-15.49579 -40.328559,-24.85535 -2.97859,-1.73884 -5.47989,-3.16152 -5.55845,-3.16152 -0.0786,0 15.59151,-14.249755 15.64919,-14.200355 0.0577,0.0494 2.87042,1.70736 6.25055,3.68435 16.715159,9.776485 32.420709,19.141505 42.724569,25.476115 3.16541,1.94603 4.26431,2.6901 4.42369,2.99529 0.18654,0.35721 0.20037,1.09652 0.11493,6.14569 -0.054,3.19134 -0.16151,6.01247 -0.24214,6.35419 -0.21119,0.89504 -0.85353,1.95942 -1.55524,2.57709 -0.5565,0.48985 -10.16024,5.83451 -11.45728,6.37619 -0.83422,0.34839 -2.44168,0.38832 -3.36084,0.0835 z m 7.31897,-5.88512 c 2.77922,-1.52044 5.16696,-2.86678 5.3061,-2.99186 0.53737,-0.48307 0.59569,-0.83928 0.6914,-4.22276 0.0515,-1.82151 0.0634,-3.31183 0.0265,-3.31183 -0.037,0 -0.42418,0.31262 -0.86046,0.69472 -2.98898,2.61781 -7.52578,4.85229 -12.04114,5.93055 l -1.00511,0.24002 0.0949,2.47404 c 0.10654,2.77594 0.2251,3.20836 1.02756,3.74768 0.89541,0.60179 1.16971,0.4979 6.76025,-2.56056 z m -3.97098,-0.59102 c -0.6227,-0.57065 -0.75254,-1.32257 -0.34155,-1.97793 0.40026,-0.63826 6.27727,-3.58724 7.14899,-3.58724 0.99604,0 1.7078,0.79795 1.55449,1.74272 -0.14447,0.89027 -0.37541,1.05734 -3.72167,2.69244 -3.63178,1.77461 -3.87283,1.83331 -4.64026,1.13001 z m -3.3119,-6.60151 c 4.70289,-1.33815 8.6453,-3.36886 11.19276,-5.76533 1.53457,-1.44361 1.52422,-1.39343 0.43009,-2.08444 l -0.9154,-0.57812 -5.26312,0.50919 c -4.85513,0.46973 -5.279,0.53118 -5.46798,0.79263 -0.28415,0.39313 -3.83538,6.69631 -3.79138,6.72942 0.0196,0.0148 0.3702,0.24925 0.77904,0.52106 0.83514,0.5552 0.61592,0.56419 3.03599,-0.12441 z m -4.21249,-6.39926 c 1.58125,-2.80833 2.16903,-3.73549 2.48171,-3.91462 0.30088,-0.17237 1.26216,-0.3139 3.61912,-0.53284 1.76518,-0.16396 3.39049,-0.34133 3.6118,-0.39414 0.373,-0.089 0.15041,-0.24884 -3.04879,-2.18916 -1.89816,-1.15123 -3.49543,-2.0393 -3.5495,-1.97349 -0.0541,0.0658 -0.45179,0.59107 -0.8838,1.16726 -0.98721,1.31665 -3.13197,3.37991 -4.46554,4.29586 -1.49067,1.02383 -3.54618,2.12467 -5.22013,2.79565 -1.13372,0.45443 -1.43015,0.62473 -1.29743,0.74534 0.0946,0.086 1.40117,0.94538 2.90345,1.90979 1.50228,0.9644 2.88464,1.87002 3.07191,2.01249 0.43114,0.32799 0.20173,0.65197 2.7772,-3.92214 z m -10.95822,-2.94757 c 4.69357,-1.44838 8.44534,-3.88887 10.69819,-6.95908 l 0.64974,-0.88547 -0.31083,-0.20709 c -0.17096,-0.11391 -2.12397,-1.28773 -4.34003,-2.6085 l -4.02919,-2.4014 -0.77373,1.0357 c -2.41549,3.23333 -5.60212,5.5933 -9.895829,7.32869 -0.60091,0.24286 -1.07983,0.48233 -1.06428,0.53214 0.0155,0.0498 1.336889,0.90281 2.936279,1.89556 1.59939,0.99275 3.24599,2.0288 3.65911,2.30235 0.41313,0.27355 0.81851,0.47664 0.90085,0.45132 0.0823,-0.0253 0.78872,-0.24322 1.56972,-0.48422 z m -10.918579,-7.10952 c 2.0762,-0.68633 4.430819,-1.79219 5.903619,-2.77266 1.42345,-0.94763 3.29692,-2.70206 4.17597,-3.91065 l 0.68808,-0.94603 -2.01339,-1.18537 c -1.10737,-0.65194 -2.97382,-1.75179 -4.14767,-2.44411 l -2.134259,-1.25875 -0.73372,1.03976 c -0.98714,1.3989 -3.05498,3.43316 -4.63198,4.55676 -1.23461,0.87966 -3.87382,2.30854 -5.44412,2.94748 -0.40614,0.16526 -0.70303,0.33585 -0.65978,0.37911 0.25378,0.25378 6.90036,4.14556 7.08526,4.14864 0.12333,0.002 0.98372,-0.24733 1.91199,-0.55418 z m -9.8525,-6.88518 c 3.68766,-1.40726 6.66191,-3.51515 8.68281,-6.15362 0.67126,-0.876375 0.75879,-1.054545 0.5933,-1.207645 -0.26932,-0.24916 -8.1254,-4.8629 -8.27063,-4.85721 -0.0648,0.003 -0.45348,0.50471 -0.86384,1.11594 -0.9517,1.41754 -3.0058,3.46737 -4.65795,4.648265 -1.20753,0.86309 -4.38615,2.58639 -5.45332,2.95651 -0.44457,0.15419 -0.45889,0.17644 -0.20486,0.31801 0.15023,0.0837 1.82458,1.05801 3.72079,2.16508 l 3.44764,2.01285 0.91276,-0.27383 c 0.50202,-0.15061 1.44401,-0.47657 2.0933,-0.72435 z m -12.58177,-6.01516 c 1.86306,-0.62136 4.25754,-1.771665 5.73685,-2.755965 1.37902,-0.91757 3.5722,-3.04186 4.36692,-4.22975 0.31132,-0.46534 0.56604,-0.87821 0.56604,-0.91748 0,-0.0862 -12.42275,8.362375 -12.24038,8.377405 0.0656,0.005 0.77236,-0.20799 1.57057,-0.47421 z"
|
||||
style="fill:#6db7ed;fill-opacity:1;stroke-width:0.516173"
|
||||
id="path1-7" /></g></svg>
|
||||
|
After Width: | Height: | Size: 17 KiB |
@@ -8,7 +8,10 @@ use crate::command::{
|
||||
use crate::entities::curve::entity_curve;
|
||||
use crate::entities::traits::EntityTypeOps;
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::modules::IconKind;
|
||||
|
||||
pub const ICON: IconKind =
|
||||
IconKind::Svg(include_bytes!("../../../../assets/icons/area.svg"));
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
enum AreaMode {
|
||||
Single,
|
||||
|
||||
@@ -4,8 +4,8 @@ use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult, WorkingPlane};
|
||||
use crate::modules::IconKind;
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
pub struct DistCommand {
|
||||
// Keep the picked point in full f64 precision. Downcasting to f32 here
|
||||
// loses ~0.03–0.06 units at survey-scale coordinates (e.g. eastings near
|
||||
@@ -13,7 +13,8 @@ pub struct DistCommand {
|
||||
first: Option<DVec3>,
|
||||
plane: WorkingPlane,
|
||||
}
|
||||
|
||||
pub const ICON: IconKind =
|
||||
IconKind::Svg(include_bytes!("../../../../assets/icons/distance.svg"));
|
||||
impl DistCommand {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
|
||||
@@ -43,6 +43,7 @@ impl CadModule for DrawModule {
|
||||
array, copy, delete, explode, fillet, mirror, offset, rotate, scale, stretch,
|
||||
translate, trim,
|
||||
};
|
||||
use inquiry::{area, dist};
|
||||
use properties::match_prop;
|
||||
|
||||
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
||||
@@ -231,6 +232,21 @@ impl CadModule for DrawModule {
|
||||
cut::tool().into(),
|
||||
],
|
||||
},
|
||||
RibbonGroup {
|
||||
title: "Measure",
|
||||
tools: vec![
|
||||
RibbonItem::LargeDropdown {
|
||||
id: "MEASURE_MENU",
|
||||
label: "Measure",
|
||||
icon: dist::ICON,
|
||||
items: vec![
|
||||
("DIST", "Distance", dist::ICON),
|
||||
("AREA", "Area", area::ICON),
|
||||
],
|
||||
default: "DIST",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Support group lives on the Start tab now (see view.rs:
|
||||
// start_page_view). Removed from the Draw ribbon to declutter.
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user