master
howard 2021-04-13 16:49:56 -07:00
parent fd2ea1d480
commit e1255f339f
6 changed files with 344 additions and 60 deletions

81
icon/svgr_raw/extrude.svg Normal file
View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg1011"
width="512"
height="512"
viewBox="0 0 512 512"
sodipodi:docname="extrude.svg"
inkscape:version="1.0.2 (1.0.2+r75+1)">
<metadata
id="metadata1017">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs1015">
<marker
style="overflow:visible"
id="TriangleOutS"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="TriangleOutS"
inkscape:isstock="true">
<path
transform="scale(0.2)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path1864" />
</marker>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1388"
inkscape:window-height="925"
id="namedview1013"
showgrid="false"
inkscape:zoom="0.67998269"
inkscape:cx="87.296086"
inkscape:cy="408.93076"
inkscape:window-x="867"
inkscape:window-y="417"
inkscape:window-maximized="0"
inkscape:current-layer="svg1011"
inkscape:snap-global="true"
inkscape:document-rotation="0" />
<g
inkscape:groupmode="layer"
inkscape:label="Image"
id="g1019" />
<path
id="path941"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.71671808;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="M 256,0 144,144.00007 h 64 V 384 h 96 V 144.80193 l 64,-1.60386 z"
sodipodi:nodetypes="cccccccc" />
<path
id="path840"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1;opacity:1"
d="M 176 302.76758 L 10.058594 369.14453 A 16.0016 16.0016 0 0 0 9.234375 398.49805 L 249.23438 510.49805 A 16.0016 16.0016 0 0 0 262.76562 510.49805 L 502.76562 398.49805 A 16.0016 16.0016 0 0 0 501.94141 369.14453 L 336 302.76758 L 336 337.23242 L 455.74609 385.13086 L 256 478.34375 L 56.253906 385.13086 L 176 337.23242 L 176 302.76758 z " />
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg1011"
width="512"
height="512"
viewBox="0 0 512 512"
sodipodi:docname="extrude_master.svg"
inkscape:version="1.0.2 (1.0.2+r75+1)">
<metadata
id="metadata1017">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs1015">
<marker
style="overflow:visible"
id="TriangleOutS"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="TriangleOutS"
inkscape:isstock="true">
<path
transform="scale(0.2)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path1864" />
</marker>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1388"
inkscape:window-height="925"
id="namedview1013"
showgrid="false"
inkscape:zoom="0.99748433"
inkscape:cx="33.096245"
inkscape:cy="336.19496"
inkscape:window-x="867"
inkscape:window-y="417"
inkscape:window-maximized="0"
inkscape:current-layer="svg1011"
inkscape:snap-global="true"
inkscape:document-rotation="0" />
<g
inkscape:groupmode="layer"
inkscape:label="Image"
id="g1019" />
<path
id="path941"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.71671808;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
d="M 256,0 144,144.00007 h 64 V 384 h 96 V 144.80193 l 64,-1.60386 z"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:none;stroke:#000000;stroke-width:32;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 256,288 16,384 256,496 496,384 Z"
id="path840"
sodipodi:nodetypes="ccccc" />
<rect
style="fill:#000000;fill-opacity:1;stroke-width:32.8023;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.716718"
id="rect873"
width="160"
height="158.28497"
x="176"
y="223.93156" />
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -27,7 +27,7 @@
inkscape:cx="22.832759"
inkscape:cy="6.3103299"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:current-layer="text841-6"
inkscape:document-rotation="0"
showgrid="false"
inkscape:window-width="1578"
@ -55,16 +55,22 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:12px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
x="0.53601015"
y="12.164"
id="text841-6"><tspan
sodipodi:role="line"
id="tspan839-3"
x="0.53601015"
y="12.164"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:'Ubuntu Condensed';-inkscape-font-specification:'Ubuntu Condensed, '">STL</tspan></text>
<g
aria-label="STL"
id="text841-6"
style="font-style:normal;font-weight:normal;font-size:12px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none">
<path
d="m 2.5760101,11.42 q 0.648,0 0.996,-0.36 0.36,-0.36 0.36,-0.972 0,-0.3240004 -0.108,-0.5760004 -0.108,-0.252 -0.288,-0.456 -0.168,-0.204 -0.396,-0.372 -0.228,-0.168 -0.468,-0.336 -0.276,-0.192 -0.576,-0.408 -0.3,-0.216 -0.552,-0.504 -0.24,-0.288 -0.396,-0.672 -0.15599995,-0.384 -0.15599995,-0.9 0,-0.504 0.16799995,-0.912 0.18,-0.408 0.48,-0.696 0.312,-0.288 0.732,-0.444 0.432,-0.156 0.924,-0.156 0.48,0 0.888,0.12 0.408,0.12 0.684,0.288 l -0.336,0.852 q -0.252,-0.168 -0.552,-0.252 -0.288,-0.096 -0.612,-0.096 -0.588,0 -0.948,0.324 -0.348,0.312 -0.348,0.924 0,0.336 0.108,0.588 0.12,0.252 0.3,0.456 0.192,0.204 0.432,0.372 0.252,0.168 0.528,0.348 0.276,0.18 0.564,0.396 0.288,0.216 0.516,0.504 0.24,0.276 0.384,0.66 0.156,0.372 0.156,0.8880004 0,0.468 -0.144,0.888 -0.144,0.42 -0.456,0.744 -0.3,0.312 -0.768,0.504 -0.456,0.18 -1.08,0.18 -0.576,0 -1.008,-0.132 -0.432,-0.132 -0.76799995,-0.348 L 1.1720101,11 q 0.312,0.192 0.636,0.312 0.336,0.108 0.768,0.108 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:'Ubuntu Condensed';-inkscape-font-specification:'Ubuntu Condensed, '"
id="path832" />
<path
d="m 10.280006,3.8479996 v 0.924 H 8.4320056 V 12.164 h -1.08 V 4.7719996 h -1.848 v -0.924 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:'Ubuntu Condensed';-inkscape-font-specification:'Ubuntu Condensed, '"
id="path834" />
<path
d="m 15.16399,11.24 v 0.924 h -3.708 V 3.8479996 h 1.08 V 11.24 Z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:'Ubuntu Condensed';-inkscape-font-specification:'Ubuntu Condensed, '"
id="path836" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -106,6 +106,142 @@ function Dimension(props) {
);
}
function Extrude(props) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 512 512"
{...props}
>
<path
style={{
lineHeight: "normal",
fontVariantLigatures: "normal",
fontVariantPosition: "normal",
fontVariantCaps: "normal",
fontVariantNumeric: "normal",
fontVariantAlternates: "normal",
fontVariantEastAsian: "normal",
fontFeatureSettings: "normal",
fontVariationSettings: "normal",
textIndent: 0,
textAlign: "start",
textDecorationLine: "none",
textDecorationStyle: "solid",
textDecorationColor: "#000",
textTransform: "none",
textOrientation: "mixed",
whiteSpace: "normal",
shapePadding: 0,
shapeMargin: 0,
inlineSize: 0,
isolation: "auto",
mixBlendMode: "normal",
solidColor: "#000",
solidOpacity: 1,
}}
d="M256 0L144 144h64v240h96V144.802l64-1.604z"
color="currentColor"
fontWeight={400}
fontFamily="sans-serif"
overflow="visible"
fillRule="evenodd"
/>
<path
style={{
lineHeight: "normal",
fontVariantLigatures: "normal",
fontVariantPosition: "normal",
fontVariantCaps: "normal",
fontVariantNumeric: "normal",
fontVariantAlternates: "normal",
fontVariantEastAsian: "normal",
fontFeatureSettings: "normal",
fontVariationSettings: "normal",
textIndent: 0,
textAlign: "start",
textDecorationLine: "none",
textDecorationStyle: "solid",
textDecorationColor: "#000",
textTransform: "none",
textOrientation: "mixed",
whiteSpace: "normal",
shapePadding: 0,
shapeMargin: 0,
inlineSize: 0,
isolation: "auto",
mixBlendMode: "normal",
solidColor: "#000",
solidOpacity: 1,
}}
d="M176 302.768L10.059 369.145a16.002 16.002 0 00-.825 29.353l240 112a16.002 16.002 0 0013.532 0l240-112a16.002 16.002 0 00-.825-29.353L336 302.768v34.464l119.746 47.899L256 478.344 56.254 385.13 176 337.232v-34.464z"
color="currentColor"
fontWeight={400}
fontFamily="sans-serif"
overflow="visible"
/>
</svg>
);
}
function Extrude_master(props) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
viewBox="0 0 512 512"
{...props}
>
<path
style={{
lineHeight: "normal",
fontVariantLigatures: "normal",
fontVariantPosition: "normal",
fontVariantCaps: "normal",
fontVariantNumeric: "normal",
fontVariantAlternates: "normal",
fontVariantEastAsian: "normal",
fontFeatureSettings: "normal",
fontVariationSettings: "normal",
textIndent: 0,
textAlign: "start",
textDecorationLine: "none",
textDecorationStyle: "solid",
textDecorationColor: "#000",
textTransform: "none",
textOrientation: "mixed",
whiteSpace: "normal",
shapePadding: 0,
shapeMargin: 0,
inlineSize: 0,
isolation: "auto",
mixBlendMode: "normal",
solidColor: "#000",
solidOpacity: 1,
}}
d="M256 0L144 144h64v240h96V144.802l64-1.604z"
color="currentColor"
fontWeight={400}
fontFamily="sans-serif"
overflow="visible"
fillRule="evenodd"
/>
<path
d="M256 288L16 384l240 112 240-112z"
fill="none"
stroke="currentColor"
strokeWidth={32}
strokeLinecap="round"
strokeLinejoin="round"
/>
<path d="M176 223.932h160v158.285H176z" />
</svg>
);
}
function Horizontal(props) {
return (
<svg
@ -238,29 +374,24 @@ function Stl(props) {
viewBox="0 0 16 16"
{...props}
>
<text
<g
aria-label="STL"
style={{
lineHeight: 1.25,
}}
x={0.536}
y={12.164}
fontWeight={400}
fontSize={12}
fontFamily="sans-serif"
fontFamily="Ubuntu Condensed"
letterSpacing={0}
wordSpacing={0}
>
<tspan
x={0.536}
y={12.164}
<path
d="M2.576 11.42q.648 0 .996-.36.36-.36.36-.972 0-.324-.108-.576-.108-.252-.288-.456-.168-.204-.396-.372t-.468-.336q-.276-.192-.576-.408-.3-.216-.552-.504-.24-.288-.396-.672-.156-.384-.156-.9 0-.504.168-.912.18-.408.48-.696.312-.288.732-.444.432-.156.924-.156.48 0 .888.12.408.12.684.288l-.336.852q-.252-.168-.552-.252-.288-.096-.612-.096-.588 0-.948.324-.348.312-.348.924 0 .336.108.588.12.252.3.456.192.204.432.372.252.168.528.348.276.18.564.396.288.216.516.504.24.276.384.66.156.372.156.888 0 .468-.144.888t-.456.744q-.3.312-.768.504-.456.18-1.08.18-.576 0-1.008-.132-.432-.132-.768-.348L1.172 11q.312.192.636.312.336.108.768.108zM10.28 3.848v.924H8.432v7.392h-1.08V4.772H5.504v-.924zM15.164 11.24v.924h-3.708V3.848h1.08v7.392z"
style={{
InkscapeFontSpecification: "'Ubuntu Condensed, '",
}}
fontFamily="Ubuntu Condensed"
>
{"STL"}
</tspan>
</text>
/>
</g>
</svg>
);
}
@ -418,4 +549,4 @@ function Vertical(props) {
</svg>
);
}
export { Arc, Coincident, Dimension, Horizontal, Intersect, Intersect_thin, Line, Stl, Subtract, Union, Union_thin, Vertical };
export { Arc, Coincident, Dimension, Extrude, Extrude_master, Horizontal, Intersect, Intersect_thin, Line, Stl, Subtract, Union, Union_thin, Vertical };

View File

@ -5,6 +5,7 @@ import React, { useEffect, useReducer } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import { FaCube, FaEdit } from 'react-icons/fa'
import { BsBoxArrowUp} from 'react-icons/bs'
import { MdDone, MdSave, MdFolder} from 'react-icons/md'
import * as Icon from "./icons";
@ -50,26 +51,26 @@ export const NavBar = () => {
forceUpdate()
// sc.activeDim = this.activeSketch.obj3d.children[1].children
}, 'Finish'],
[FaCube, extrude, 'Extrude [e]'],
[Icon.Dimension, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Dimension [d]'],
[Icon.Extrude, extrude, 'Extrude [e]'],
[Icon.Dimension, () => sc.activeSketch.drawDimension(), 'Dimension [d]'],
[Icon.Line, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Line [l]'],
[Icon.Arc, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [a]'],
[Icon.Coincident, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [a]'],
[Icon.Vertical, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [a]'],
[Icon.Horizontal, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [a]'],
[Icon.Coincident, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [space]'],
[Icon.Vertical, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [v]'],
[Icon.Horizontal, () => sc.extrude(treeEntries.byId[activeSketchId]), 'Arc [h]'],
]
const btnz2 = [
[FaEdit, sc.addSketch, 'Sketch [s]']
,
[FaCube, extrude, 'Extrude [e]'],
[Icon.Extrude, extrude, 'Extrude [e]'],
[Icon.Union, () => boolOp('u'), 'Union'],
[Icon.Subtract, () => boolOp('s'), 'Subtract'],
[Icon.Intersect, () => boolOp('i'), 'Intersect'],
[MdSave, () => boolOp('i'), 'Intersect'],
[MdFolder, () => boolOp('i'), 'Intersect'],
[Icon.Stl, () => boolOp('i'), 'Intersect'],
[MdSave, () => boolOp('i'), 'Save [ctrl+s]'],
[MdFolder, () => boolOp('i'), 'Load'],
[Icon.Stl, () => boolOp('i'), 'Export STL'],
]
const [_, forceUpdate] = useReducer(x => x + 1, 0);

View File

@ -22,6 +22,8 @@ horizontal // done
- select sketch for extrusion, punt, leverage current sketch modality
constraint angle // done
button panel cleanup // done
-unable to delete arc
hover not clearing sometimes
@ -35,32 +37,6 @@ file save, stl export
button panel cleanup
- finish
- extrude
- dim
-line
- arc
- vertical
- horizontal
-coincident
sketch
extrude
boolean +
boolean
boolean
load
save
stl
better default ent names