[openscad] add ulrich's mirror mesh macro, fix error in refine shape
This commit is contained in:
committed by
Yorik van Havre
parent
d106be0b9b
commit
c5b93d698e
@@ -49,7 +49,7 @@ class OpenSCADWorkbench ( Workbench ):
|
||||
return text
|
||||
import OpenSCAD_rc,OpenSCADCommands
|
||||
commands = ['OpenSCAD_ReplaceObject','OpenSCAD_RemoveSubtree',
|
||||
'OpenSCAD_RefineShapeFeature','OpenSCAD_IncreaseToleranceFeature',
|
||||
'OpenSCAD_RefineShapeFeature','OpenSCAD_MirrorMeshFeature','OpenSCAD_IncreaseToleranceFeature',
|
||||
'OpenSCAD_Edgestofaces', 'OpenSCAD_ExpandPlacements','OpenSCAD_ExplodeGroup']
|
||||
toolbarcommands = ['OpenSCAD_ReplaceObject','OpenSCAD_RemoveSubtree',
|
||||
'OpenSCAD_ExplodeGroup','OpenSCAD_RefineShapeFeature',
|
||||
|
||||
@@ -157,6 +157,26 @@ class RefineShapeFeature:
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP('OpenSCAD_RefineShapeFeature', 'Refine Shape Feature'),
|
||||
'ToolTip' : QtCore.QT_TRANSLATE_NOOP('OpenSCAD_RefineShapeFeature', 'Create Refine Shape Feature')}
|
||||
|
||||
class MirrorMeshFeature:
|
||||
def IsActive(self):
|
||||
return FreeCADGui.Selection.countObjectsOfType('Mesh::Feature') > 0
|
||||
|
||||
def Activated(self):
|
||||
import Part,OpenSCADFeatures,OpenSCADUtils
|
||||
selection=FreeCADGui.Selection.getSelectionEx()
|
||||
for selobj in selection:
|
||||
newobj=selobj.Document.addObject("Mesh::Feature",'mirror')
|
||||
newobj.Label='mirror_%s' % selobj.Object.Label
|
||||
msh=selobj.Object.Mesh
|
||||
newobj.Mesh=OpenSCADUtils.mirror(msh)
|
||||
selobj.Object.ViewObject.hide()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
def GetResources(self):
|
||||
return {'Pixmap' : 'OpenSCAD_MirrorMeshFeature',
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP('OpenSCAD_MirrorMeshFeature', 'Mirror Mesh Feature'),
|
||||
'ToolTip' : QtCore.QT_TRANSLATE_NOOP('OpenSCAD_MirrorMeshFeature', 'Create Mirror Mesh Feature')}
|
||||
|
||||
|
||||
class IncreaseToleranceFeature:
|
||||
def IsActive(self):
|
||||
return FreeCADGui.Selection.countObjectsOfType('Part::Feature') > 0
|
||||
@@ -422,6 +442,7 @@ FreeCADGui.addCommand('OpenSCAD_ColorCodeShape',ColorCodeShape())
|
||||
FreeCADGui.addCommand('OpenSCAD_ExplodeGroup',ExplodeGroup())
|
||||
FreeCADGui.addCommand('OpenSCAD_Edgestofaces',Edgestofaces())
|
||||
FreeCADGui.addCommand('OpenSCAD_RefineShapeFeature',RefineShapeFeature())
|
||||
FreeCADGui.addCommand('OpenSCAD_MirrorMeshFeature',MirrorMeshFeature())
|
||||
FreeCADGui.addCommand('OpenSCAD_IncreaseToleranceFeature',IncreaseToleranceFeature())
|
||||
FreeCADGui.addCommand('OpenSCAD_ExpandPlacements',ExpandPlacements())
|
||||
FreeCADGui.addCommand('OpenSCAD_ReplaceObject',ReplaceObject())
|
||||
|
||||
@@ -273,7 +273,8 @@ class RefineShape:
|
||||
|
||||
def execute(self, fp):
|
||||
if fp.Base and fp.Base.Shape.isValid():
|
||||
import freecad.OpenSCAD.OpenSCADUtils
|
||||
#import freecad.OpenSCAD.OpenSCADUtils
|
||||
import OpenSCADUtils
|
||||
sh=fp.Base.Shape.removeSplitter()
|
||||
fp.Shape=freecad.OpenSCAD.OpenSCADUtils.applyPlacement(sh)
|
||||
|
||||
|
||||
@@ -298,6 +298,19 @@ def vec2householder(nv):
|
||||
nv.z*nv.x*l,nv.z*nv.y*l,nv.z*nv.z*l,0,0,0,0,0)
|
||||
return FreeCAD.Matrix()-hh
|
||||
|
||||
def mirror(msh):
|
||||
from exportCSG import mesh2polyhedron
|
||||
from PySide import QtGui
|
||||
items=["[1,0,0]","[0,1,0]","[0,0,1]","[1,1,0]","[0,1,1]","[1,0,1]","[1,1,1]"]
|
||||
item, ok = QtGui.QInputDialog.getItem(QtGui.QApplication.activeWindow(),u'Mirror about which Axis?',u'Select Axis (or enter custom value)?',items,editable=True)
|
||||
if ok:
|
||||
param = 'mirror('+item+')'
|
||||
poly = mesh2polyhedron(msh)
|
||||
mi = callopenscadmeshstring('%s{%s}' % (param,''.join(poly)))
|
||||
mi.flipNormals()
|
||||
return mi
|
||||
return msh
|
||||
|
||||
|
||||
def angneg(d):
|
||||
return d if (d <= 180.0) else (d-360)
|
||||
|
||||
541
src/Mod/OpenSCAD/Resources/icons/OpenSCAD_MirrorMeshFeature.svg
Normal file
541
src/Mod/OpenSCAD/Resources/icons/OpenSCAD_MirrorMeshFeature.svg
Normal file
@@ -0,0 +1,541 @@
|
||||
<?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:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
id="svg3052"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
sodipodi:docname="OpenSCAD_MirrorMeshFeature.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
version="1.1"
|
||||
inkscape:export-filename="/home/user/Downloads/cad/mystuff/icons/Part and general/Part_Refine_Shape/Part_Refine_Shape_Parametric_16px.png"
|
||||
inkscape:export-xdpi="22.5"
|
||||
inkscape:export-ydpi="22.5">
|
||||
<defs
|
||||
id="defs3054">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3968">
|
||||
<stop
|
||||
style="stop-color:#204a87;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3970" />
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3972" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3960">
|
||||
<stop
|
||||
style="stop-color:#204a87;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3962" />
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3964" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4032">
|
||||
<stop
|
||||
style="stop-color:#71b2f8;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4034" />
|
||||
<stop
|
||||
style="stop-color:#002795;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4036" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective3060" />
|
||||
<linearGradient
|
||||
id="linearGradient3377">
|
||||
<stop
|
||||
id="stop3379"
|
||||
offset="0"
|
||||
style="stop-color:#4bff54;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3381"
|
||||
offset="1"
|
||||
style="stop-color:#00b800;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3199">
|
||||
<stop
|
||||
id="stop3201"
|
||||
offset="0"
|
||||
style="stop-color:#faff2b;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3203"
|
||||
offset="1"
|
||||
style="stop-color:#ffaa00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3377"
|
||||
id="radialGradient3692"
|
||||
cx="45.883327"
|
||||
cy="28.869568"
|
||||
fx="45.883327"
|
||||
fy="28.869568"
|
||||
r="19.467436"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3206">
|
||||
<stop
|
||||
id="stop3208"
|
||||
offset="0"
|
||||
style="stop-color:#faff2b;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3210"
|
||||
offset="1"
|
||||
style="stop-color:#ffaa00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4032-5"
|
||||
id="radialGradient3703-5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
cx="133.69075"
|
||||
cy="92.823502"
|
||||
fx="133.69075"
|
||||
fy="92.823502"
|
||||
r="19.467436"
|
||||
gradientTransform="matrix(-0.08150155,0.8812939,-1.1555294,-0.17035295,253.69838,-14.119161)" />
|
||||
<linearGradient
|
||||
id="linearGradient4032-5">
|
||||
<stop
|
||||
style="stop-color:#71b2f8;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4034-3" />
|
||||
<stop
|
||||
style="stop-color:#002795;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4036-6" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3377-9">
|
||||
<stop
|
||||
id="stop3379-3"
|
||||
offset="0"
|
||||
style="stop-color:#faff2b;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3381-7"
|
||||
offset="1"
|
||||
style="stop-color:#ffaa00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3377-9"
|
||||
id="radialGradient3144"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9818943,0.1894295,-0.4109427,2.1300924,-24.621424,-189.11511)"
|
||||
cx="76.383331"
|
||||
cy="94.369568"
|
||||
fx="76.383331"
|
||||
fy="94.369568"
|
||||
r="19.467436" />
|
||||
<linearGradient
|
||||
id="linearGradient3162">
|
||||
<stop
|
||||
id="stop3164"
|
||||
offset="0"
|
||||
style="stop-color:#faff2b;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3166"
|
||||
offset="1"
|
||||
style="stop-color:#ffaa00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3377-9"
|
||||
id="radialGradient4047"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-0.26138713,0.54129082,-1.0901609,-0.48453763,158.43617,23.491203)"
|
||||
cx="86.836884"
|
||||
cy="90.601151"
|
||||
fx="86.836884"
|
||||
fy="90.601151"
|
||||
r="19.467436" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3377-9-9"
|
||||
id="radialGradient4049"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.8492421,1.2585119,-0.4040415,0.9147407,-125.84131,-100.25805)"
|
||||
cx="84.883324"
|
||||
cy="77.042847"
|
||||
fx="84.883324"
|
||||
fy="77.042847"
|
||||
r="19.467436" />
|
||||
<linearGradient
|
||||
id="linearGradient3377-9-9">
|
||||
<stop
|
||||
id="stop3379-3-2"
|
||||
offset="0"
|
||||
style="stop-color:#faff2b;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3381-7-3"
|
||||
offset="1"
|
||||
style="stop-color:#ffaa00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="19.467436"
|
||||
fy="77.042847"
|
||||
fx="84.883324"
|
||||
cy="77.042847"
|
||||
cx="84.883324"
|
||||
gradientTransform="matrix(0.05484005,0.20633765,-1.3480108,0.19469672,184.08291,44.528235)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient4066"
|
||||
xlink:href="#linearGradient3377-9-9"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4032"
|
||||
id="linearGradient3957"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.96628924,0,0,0.97142924,3.6966536,2.8994362)"
|
||||
x1="133.93095"
|
||||
y1="36.432716"
|
||||
x2="184.15427"
|
||||
y2="87.916885" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4032"
|
||||
id="linearGradient3959"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="94.056625"
|
||||
y1="82.853188"
|
||||
x2="89.819969"
|
||||
y2="72.796349" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4032"
|
||||
id="linearGradient3961"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.96628924,0,0,0.97142924,3.6966536,2.8994362)"
|
||||
x1="133.93095"
|
||||
y1="36.432716"
|
||||
x2="184.15427"
|
||||
y2="87.916885" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4032"
|
||||
id="linearGradient3963"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="94.056625"
|
||||
y1="82.853188"
|
||||
x2="89.819969"
|
||||
y2="72.796349" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4032"
|
||||
id="linearGradient3974"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.96628924,0,0,0.97142924,3.6966536,2.8994362)"
|
||||
x1="159.48199"
|
||||
y1="58.87999"
|
||||
x2="183.4729"
|
||||
y2="104.34172" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3864"
|
||||
id="radialGradient2401"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.959337,0.05179994,0,0.7352325,-29.610908,-1.231413)"
|
||||
cx="51.105499"
|
||||
cy="23.807407"
|
||||
fx="51.105499"
|
||||
fy="23.807407"
|
||||
r="19.571428" />
|
||||
<linearGradient
|
||||
id="linearGradient3864">
|
||||
<stop
|
||||
id="stop3866"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3868"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3960"
|
||||
id="linearGradient3966"
|
||||
x1="-23"
|
||||
y1="61"
|
||||
x2="-31"
|
||||
y2="35"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.99180788,0,0,0.99611961,37.051216,-14.010951)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3968"
|
||||
id="linearGradient3975"
|
||||
x1="-21.272728"
|
||||
y1="59.636368"
|
||||
x2="-28.909092"
|
||||
y2="34.818184"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0390368,0,0,1.0435538,36.342782,-15.481414)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3806"
|
||||
id="linearGradient3012"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.4500001,0,0,1.4705882,-27.45,-15.05882)"
|
||||
x1="22.62105"
|
||||
y1="35.470131"
|
||||
x2="61.526257"
|
||||
y2="32.273422" />
|
||||
<linearGradient
|
||||
id="linearGradient3806">
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3808" />
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3810" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3968"
|
||||
id="linearGradient3975-3"
|
||||
x1="-21.272728"
|
||||
y1="59.636368"
|
||||
x2="-28.909092"
|
||||
y2="34.818184"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0390368,0,0,1.0435538,-27.984631,-76.706905)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3968"
|
||||
id="linearGradient3966-5"
|
||||
x1="-23"
|
||||
y1="61"
|
||||
x2="-31"
|
||||
y2="35"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.99180788,0,0,0.99611961,-27.276197,-75.236442)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8.2830657"
|
||||
inkscape:cx="36.267334"
|
||||
inkscape:cy="29.623243"
|
||||
inkscape:current-layer="svg3052"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="900"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-global="true"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:snap-nodes="false">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid3041"
|
||||
empspacing="2"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata3057">
|
||||
<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>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>[Sebastian Hoogen]</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:title>OpenSCAD_RefineShapeFeature</dc:title>
|
||||
<dc:date>2012-05-03</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/OpenSCAD/Resources/icons/OpenSCAD_RefineShape</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="g3947"
|
||||
transform="matrix(0.49076004,0.51305093,-0.52342121,0.48103687,-17.3633,17.650448)"
|
||||
inkscape:transform-center-x="0.1100357"
|
||||
inkscape:transform-center-y="-0.79451631">
|
||||
<g
|
||||
id="g3817" />
|
||||
</g>
|
||||
<g
|
||||
id="g3884"
|
||||
transform="matrix(0.63023368,0,0,0.62944884,-1.1547433,23.658183)"
|
||||
style="stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<g
|
||||
id="g3888"
|
||||
transform="matrix(0.63023368,0,0,0.62944884,-2.9496241,20.620646)" />
|
||||
<g
|
||||
style="stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
transform="matrix(0.63023368,0,0,0.62944884,24.872451,0.6371694)"
|
||||
id="g3935" />
|
||||
<g
|
||||
transform="matrix(0.63023368,0,0,0.62944884,23.07757,-2.4003676)"
|
||||
id="g3937" />
|
||||
<rect
|
||||
style="fill:url(#linearGradient3966);fill-opacity:1;stroke:#0b1521;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043"
|
||||
width="17.852541"
|
||||
height="17.930153"
|
||||
x="2.33794"
|
||||
y="26.829952" />
|
||||
<rect
|
||||
style="fill:none;stroke:#729fcf;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-3"
|
||||
width="15.868926"
|
||||
height="13.945675"
|
||||
x="2.33794"
|
||||
y="28.822191" />
|
||||
<ellipse
|
||||
style="fill:url(#linearGradient3975);fill-opacity:1;stroke:#0b1521;stroke-width:1.98792267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="path3831"
|
||||
cx="19.198675"
|
||||
cy="27.826071"
|
||||
rx="10.909885"
|
||||
ry="10.957314" />
|
||||
<ellipse
|
||||
style="fill:none;stroke:#729fcf;stroke-width:1.98792267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="path3831-6"
|
||||
cx="19.198675"
|
||||
cy="27.826073"
|
||||
rx="8.9262705"
|
||||
ry="8.9650764" />
|
||||
<rect
|
||||
style="fill:none;stroke:#0b1521;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-7"
|
||||
width="17.852541"
|
||||
height="17.930153"
|
||||
x="2.33794"
|
||||
y="26.829952" />
|
||||
<rect
|
||||
style="fill:none;stroke:#729fcf;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-3-5"
|
||||
width="13.88531"
|
||||
height="13.945675"
|
||||
x="4.3215561"
|
||||
y="28.822191" />
|
||||
<ellipse
|
||||
style="fill:none;stroke:#0b1521;stroke-width:1.98792267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="path3831-3"
|
||||
cx="19.198675"
|
||||
cy="27.826071"
|
||||
rx="10.909885"
|
||||
ry="10.957314" />
|
||||
<rect
|
||||
style="fill:url(#linearGradient3966-5);fill-opacity:1;stroke:#0b1521;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-6"
|
||||
width="17.852541"
|
||||
height="17.930153"
|
||||
x="-61.989471"
|
||||
y="-34.395538"
|
||||
transform="scale(-1)" />
|
||||
<rect
|
||||
style="fill:none;stroke:#729fcf;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-3-2"
|
||||
width="15.868926"
|
||||
height="13.945675"
|
||||
x="-61.989471"
|
||||
y="-32.403301"
|
||||
transform="scale(-1)" />
|
||||
<ellipse
|
||||
style="fill:url(#linearGradient3975-3);fill-opacity:1;stroke:#0b1521;stroke-width:1.98792267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="path3831-9"
|
||||
cx="-45.128738"
|
||||
cy="-33.399422"
|
||||
rx="10.909885"
|
||||
ry="10.957314"
|
||||
transform="scale(-1)" />
|
||||
<ellipse
|
||||
style="fill:none;stroke:#729fcf;stroke-width:1.98792267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="path3831-6-1"
|
||||
cx="-45.128738"
|
||||
cy="-33.399418"
|
||||
rx="8.9262705"
|
||||
ry="8.9650764"
|
||||
transform="scale(-1)" />
|
||||
<rect
|
||||
style="fill:none;stroke:#0b1521;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-7-2"
|
||||
width="17.852541"
|
||||
height="17.930153"
|
||||
x="-61.989471"
|
||||
y="-34.395538"
|
||||
transform="scale(-1)" />
|
||||
<rect
|
||||
style="fill:none;stroke:#729fcf;stroke-width:1.98792279;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="rect3043-3-5-7"
|
||||
width="13.88531"
|
||||
height="13.945675"
|
||||
x="-60.005859"
|
||||
y="-32.403301"
|
||||
transform="scale(-1)" />
|
||||
<ellipse
|
||||
style="fill:none;stroke:#0b1521;stroke-width:1.98792267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.80000019;stroke-opacity:1"
|
||||
id="path3831-3-0"
|
||||
cx="-45.128738"
|
||||
cy="-33.399422"
|
||||
rx="10.909885"
|
||||
ry="10.957314"
|
||||
transform="scale(-1)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -80,7 +80,9 @@ def check_multmatrix(csg,ob,x,y,z):
|
||||
def mesh2polyhedron(mesh):
|
||||
pointstr=','.join(['[%f,%f,%f]' % tuple(vec) for vec in mesh.Topology[0]])
|
||||
trianglestr=','.join(['[%d,%d,%d]' % tuple(tri) for tri in mesh.Topology[1]])
|
||||
return 'polyhedron ( points = [%s], triangles = [%s]);' % (pointstr,trianglestr)
|
||||
#avoid deprecation warning by changing triangles to faces
|
||||
#return 'polyhedron ( points = [%s], triangles = [%s]);' % (pointstr,trianglestr)
|
||||
return 'polyhedron ( points = [%s], faces = [%s]);' % (pointstr,trianglestr)
|
||||
|
||||
def vector2d(v):
|
||||
return [v[0],v[1]]
|
||||
|
||||
Reference in New Issue
Block a user