Add part move command

This commit is contained in:
Zheng, Lei 2017-10-18 18:11:37 +08:00
parent 80c89ef0a2
commit ccc6a89165
4 changed files with 469 additions and 101 deletions

View File

@ -0,0 +1,241 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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"
width="64px"
height="64px"
id="svg8277"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="Assembly_AxialMove.svg">
<defs
id="defs8279" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.8890873"
inkscape:cx="23.639218"
inkscape:cy="24.966666"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1375"
inkscape:window-height="876"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:snap-global="true"
inkscape:snap-bbox="true"
inkscape:snap-nodes="false">
<inkscape:grid
type="xygrid"
id="grid5625"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata8282">
<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>Path-Axis</dc:title>
<dc:date>2015-07-04</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Axis.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g4253"
transform="matrix(0.96151017,-0.27476936,0.27476936,0.96151017,-53.457301,4.8258519)">
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="rect3200"
d="m 43.784152,52.646316 27.999995,7.999998 0,18 -27.999995,-7.999999 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:54.21519089px;font-family:Arial;-inkscape-font-specification:Arial;display:inline;overflow:visible;visibility:visible;fill:#3465a4;fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="rect3200-8"
d="m 71.784147,60.646314 25.999998,-11.999997 0,15.999998 -25.999998,13.999999 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:54.21519089px;font-family:Arial;-inkscape-font-specification:Arial;display:inline;overflow:visible;visibility:visible;fill:#204a87;fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="rect3200-5"
d="M 70.784146,40.646318 97.784145,48.646317 71.784147,60.646314 43.784152,52.646316 Z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:54.21519089px;font-family:Arial;-inkscape-font-specification:Arial;display:inline;overflow:visible;visibility:visible;fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path3805"
d="m 45.784152,55.286942 0,13.882811 23.992185,6.828125 0.02342,-13.835939 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:54.21519089px;font-family:Arial;-inkscape-font-specification:Arial;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path3807"
d="m 73.784149,61.904127 0,13.390624 21.999994,-11.84375 0.0078,-11.687496 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:54.21519089px;font-family:Arial;-inkscape-font-specification:Arial;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#3465a4;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="rect3200-5-3-6"
d="M 71.298405,40.890788 98.298397,48.890786 72.298406,60.890784 44.298411,52.890785 Z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:54.21519089px;font-family:Arial;-inkscape-font-specification:Arial;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ef2929;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
</g>
<g
id="g4199">
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path6397-3"
d="M 28.282635,34.084733 51.090922,14.636314"
style="fill:none;stroke:#172a04;stroke-width:8;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
<g
id="g4191">
<path
style="fill:#8ae234;fill-opacity:1;stroke:#172a04;stroke-width:2.00000024;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="m 56.301546,9.8662949 c 2.380189,2.4586491 2.356371,7.1457861 0.562268,8.4303771 -1.794104,1.284591 -3.882477,1.614145 -6.262666,-0.844506 -2.380188,-2.45865 -3.71292,-5.928709 -2.506121,-7.9449766 1.206798,-2.0162674 5.82633,-2.0995447 8.206519,0.3591055 z"
id="path6514"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sssss" />
<path
style="fill:#73d216;stroke:#172a04;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="M 57.675023,17.196253 C 59.125757,14.079173 55.786493,7.1175596 49.88913,8.2225984 L 61.683856,6.0125218 Z"
id="path6475-3-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#8ae234;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 54.164074,9.3183964 6.831678,-1.301668"
id="path6571"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#172a04;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="M 57.656587,17.221263 C 59.10732,14.104182 55.768056,7.1425689 49.870693,8.2476077 L 61.665419,6.0375311 Z"
id="path6475-3-5-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#73d216;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="M 28.282635,34.084733 51.090922,14.636314"
id="path6397-3-7"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#8ae234;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="M 27.716662,33.28548 50.524948,13.83706"
id="path6397-3-7-7"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
<g
id="g4184">
<path
style="fill:none;stroke:#0b1521;stroke-width:8;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 20.574,14.664038 7.708635,19.420695"
id="path6419"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#3465a4;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 20.574,14.664038 7.708635,19.420695"
id="path6419-6"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="m 19.591106,14.848211 7.708636,19.420696"
id="path6419-6-2"
inkscape:connector-curvature="0" />
<path
style="fill:#3465a4;stroke:#0b1521;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="M 25.784624,9.8940192 C 24.447439,13.983293 16.814109,16.316975 13.522059,15.037005 l 1.87136,-11.7316318 z"
id="path6475"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="m 23.173929,10.50514 c -1.088305,1.548234 -4.835095,3.046266 -7.403563,2.95258 l 1.047955,-6.930515 z"
id="path6475-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
</g>
<g
transform="matrix(0.86294131,-0.50530416,0.50530416,0.86294131,-13.724535,18.864876)"
id="g4177">
<path
style="fill:none;stroke:#280000;stroke-width:8;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="M 28.282635,34.084733 48.721677,45.429535"
id="path6397"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#cc0000;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="M 28.282635,34.084733 48.721677,45.429535"
id="path6397-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
d="M 27.563165,34.802163 48.002207,46.146965"
id="path6397-5-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="m 44.154236,49.799985 c -1.00857,-4.115837 4.453037,-9.683235 8.029404,-10.133289 l 4.620086,10.887343 z"
id="path6475-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:32.20000076;stroke-opacity:1"
d="m 46.097609,48.060608 c 0.127899,-1.831027 2.617666,-4.866574 4.923727,-5.991774 l 2.785967,6.402357 z"
id="path6475-6-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
</g>
</g>
<g
transform="matrix(-0.13748248,-0.44180116,0.44180116,-0.13748248,38.21305,58.769026)"
id="g6846-8" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -14,8 +14,8 @@
height="64px"
id="svg2963"
sodipodi:version="0.32"
inkscape:version="0.48.5 r10040"
sodipodi:docname="Draft_Move.svg"
inkscape:version="0.91 r13725"
sodipodi:docname="Assembly_BallMove.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
@ -180,6 +180,17 @@
x2="44"
y2="52"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3836-0-6-92-4-2">
<stop
style="stop-color:#a40000;stop-opacity:1"
offset="0"
id="stop3838-2-7-06-8-0" />
<stop
style="stop-color:#ef2929;stop-opacity:1"
offset="1"
id="stop3840-5-5-8-7-23" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
@ -188,17 +199,17 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="10.193662"
inkscape:cx="21.49082"
inkscape:cy="36.860521"
inkscape:zoom="5.096831"
inkscape:cx="27.131756"
inkscape:cy="-8.8149386"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1600"
inkscape:window-height="837"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-width="1375"
inkscape:window-height="876"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:snap-global="true"
inkscape:window-maximized="1">
<inkscape:grid
@ -226,98 +237,118 @@
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<rect
style="fill:url(#linearGradient3936);fill-opacity:1;stroke:none"
id="rect3126"
width="12"
height="6"
x="26"
y="29" />
<rect
style="fill:url(#linearGradient3944);fill-opacity:1;stroke:none"
id="rect3126-2"
width="6"
height="11.999999"
x="29"
y="26" />
<g
id="g4351"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/move.png"
inkscape:export-xdpi="6.5591564"
inkscape:export-ydpi="6.5591564"
transform="matrix(0.1378133,0,0,0.1378133,-221.39699,-138.35275)" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient3154);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 37,28 0,-15 6,0 -11,-10 -11,10 6,0 0,15"
id="path3343"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 35,29 35,11 37.831259,11 32,5.7026937 26.168741,11 29,11 29,29"
id="path3343-2"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient3158);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 37,37 14,0 0,6 10,-11 -10,-11 0,6 -14,0"
id="path3343-3"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 35,35 18,0 0,2.831259 L 58.297306,32 53,26.168741 53,29 34,29"
id="path3343-2-5"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient3156);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 27,37 -14,0 0,6 -10,-11 10,-11 0,6 14,0"
id="path3343-3-2"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 29,35 11,35 11,37.831259 5.702694,32 11,26.168741 11,29 30,29"
id="path3343-2-5-7"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linearGradient3160);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 37,36 0,15 6,0 -11,10 -11,-10 6,0 0,-15"
id="path3343-0"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 35,34 0,19 2.831259,0 L 32,58.297306 26.168741,53 29,53 29,34"
id="path3343-2-6"
sodipodi:nodetypes="ccccccc"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
inkscape:export-xdpi="4.1683898"
inkscape:export-ydpi="4.1683898" />
<g
id="g4199"
transform="matrix(0.80000094,0,0,0.80000094,6.39997,6.3999698)">
<rect
y="29"
x="26"
height="6"
width="12"
id="rect3126"
style="fill:url(#linearGradient3936);fill-opacity:1;stroke:none" />
<rect
y="26"
x="29"
height="11.999999"
width="6"
id="rect3126-2"
style="fill:url(#linearGradient3944);fill-opacity:1;stroke:none" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343"
d="m 37,28 0,-15 6,0 -11,-10 -11,10 6,0 0,15"
style="fill:url(#linearGradient3154);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-2"
d="M 35,29 35,11 37.831259,11 32,5.7026937 26.168741,11 29,11 29,29"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-3"
d="m 37,37 14,0 0,6 10,-11 -10,-11 0,6 -14,0"
style="fill:url(#linearGradient3158);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-2-5"
d="m 35,35 18,0 0,2.831259 L 58.297306,32 53,26.168741 53,29 34,29"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-3-2"
d="m 27,37 -14,0 0,6 -10,-11 10,-11 0,6 14,0"
style="fill:url(#linearGradient3156);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-2-5-7"
d="M 29,35 11,35 11,37.831259 5.702694,32 11,26.168741 11,29 30,29"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-0"
d="m 37,36 0,15 6,0 -11,10 -11,-10 6,0 0,-15"
style="fill:url(#linearGradient3160);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="ccccccc"
id="path3343-2-6"
d="m 35,34 0,19 2.831259,0 L 32,58.297306 26.168741,53 29,53 29,34"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
<g
id="g4261"
transform="translate(-1.9309158,-71.866669)">
<circle
id="path3006"
style="fill:none;stroke:#204a87;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-dasharray:none;stroke-dashoffset:20.39999962;stroke-opacity:1"
cx="33.930916"
cy="103.86667"
r="27" />
<circle
id="path3006-6"
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-dasharray:none;stroke-dashoffset:20.39999962;stroke-opacity:1"
cx="33.930916"
cy="103.86667"
r="27" />
</g>
</g>
<metadata
id="metadata5006">
@ -327,7 +358,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Draft_Move</dc:title>
<dc:title></dc:title>
<cc:license
rdf:resource="" />
<dc:date>Mon Oct 10 13:44:52 2011 +0000</dc:date>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -321,8 +321,8 @@ class AsmElementLink(AsmBase):
obj.addProperty("App::PropertyXLink","LinkedObject"," Link",'')
super(AsmElementLink,self).attach(obj)
def execute(self,_obj):
self.getInfo(True)
def execute(self,obj):
obj.ViewObject.Proxy.onExecute(self.getInfo(True))
return False
def getAssembly(self):
@ -549,7 +549,76 @@ def setPlacement(part,pla,undoDocs,undoName=None):
class ViewProviderAsmElementLink(ViewProviderAsmBase):
pass
def __init__(self,vobj):
self._draggingPart = None
self._draggingOffset = None
self._draggingOffsetInv = None
self._draggingUndos = None
self._draggingPlacement = None
super(ViewProviderAsmElementLink,self).__init__(vobj)
def doubleClicked(self, vobj):
return vobj.Document.setEdit(vobj,1)
def onExecute(self,info):
if not getattr(self,'_draggingPart',None):
return
self._draggingPart = info.Part
self._draggingPlacement = info.Placement.multiply(
FreeCAD.Placement(self._draggingOffset))
self.ViewObject.DraggingPlacement = self._draggingPlacement
def initDraggingPlacement(self):
obj = self.ViewObject.Object
info = obj.Proxy.getInfo()
self._draggingPart = info.Part
rot = utils.getElementRotation(info.Shape)
if not rot:
# in case the shape has no normal, like a vertex, just use an empty
# rotation, which means having the same rotation has the owner part.
rot = FreeCAD.Rotation()
pla = FreeCAD.Placement(utils.getElementPos(info.Shape),rot)
self._draggingOffset = FreeCAD.Placement(pla.toMatrix())
self._draggingOffsetInv = FreeCAD.Placement(pla.toMatrix().inverse())
self._draggingPlacement = info.Placement.multiply(pla)
mat = FreeCADGui.editDocument().EditingTransform
return (mat,self._draggingPlacement,info.Shape.BoundBox)
def onDragStart(self):
self._draggingUndos = set()
def onDragMotion(self):
pla = self.ViewObject.DraggingPlacement.multiply(
self._draggingOffsetInv)
setPlacement(self._draggingPart,pla,
self._draggingUndos, 'Assembly drag')
obj = self.ViewObject.Object
from PySide import QtCore,QtGui
if QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
obj.getLinkedObject(False).recompute()
obj.recompute()
return
try:
asm3.solver.solve(obj.Proxy.getAssembly().Object)
except RuntimeError as e:
logger.error(e)
return self._draggingPlacement
def onDragEnd(self):
for doc in self._draggingUndos:
doc.commitTransaction()
self._draggingUndos.clear()
def unsetEdit(self,_vobj,_mode):
self._draggingPart = None
self._draggingOffset = None
self._draggingOffsetInv = None
self._draggingUndos = None
self._draggingPlacement = None
return False
class AsmConstraint(AsmGroup):

31
gui.py
View File

@ -1,7 +1,7 @@
from future.utils import with_metaclass
import FreeCAD, FreeCADGui
from asm3.utils import logger,objName,addIconToFCAD
from asm3.assembly import Assembly,AsmConstraint
from asm3.assembly import isTypeOf,Assembly,AsmConstraint,AsmElementLink
from asm3.proxy import ProxyType
class SelectionObserver:
@ -103,7 +103,34 @@ class AsmCmdMove(AsmCmdBase):
_id = 2
_menuText = 'Move part'
_iconName = 'Assembly_Move.svg'
_useCenterballDragger = True
@classmethod
def getSelection(cls):
sels = FreeCADGui.Selection.getSelection()
if len(sels)==1 and isTypeOf(sels[0],AsmElementLink):
return sels[0].ViewObject
def Activated(self):
pass
vobj = self.getSelection()
if vobj:
doc = FreeCADGui.editDocument()
if doc:
doc.resetEdit()
vobj.UseCenterballDragger = self._useCenterballDragger
vobj.doubleClicked()
@classmethod
def checkActive(cls):
cls._active = True if cls.getSelection() else False
@classmethod
def deactive(cls):
cls._active = False
class AsmCmdAxialMove(AsmCmdMove):
_id = 3
_menuText = 'Axial move part'
_iconName = 'Assembly_AxialMove.svg'
_useCenterballDragger = False