Commit a28d4efc authored by Lars Kruse's avatar Lars Kruse

Merge branch 'master' into libarea

* fix for "get_points_of_arc"
* additional example polygon
* bits and pieces
parents f9721e12 ddf06eb2
...@@ -115,9 +115,8 @@ def get_points_of_arc(center, radius, a1, a2, plane=None, cords=32): ...@@ -115,9 +115,8 @@ def get_points_of_arc(center, radius, a1, a2, plane=None, cords=32):
num_of_segments = ceil(angle_diff / (2 * math.pi) * cords) num_of_segments = ceil(angle_diff / (2 * math.pi) * cords)
angle_segment = angle_diff / num_of_segments angle_segment = angle_diff / num_of_segments
points = [] points = []
get_angle_point = lambda angle: ( get_angle_point = lambda angle: (center[0] + radius * math.cos(angle),
center[0] + radius * math.cos(angle), center[1] + radius * math.sin(angle), 0)
center[1] + radius * math.sin(angle))
points.append(get_angle_point(a1)) points.append(get_angle_point(a1))
for index in range(num_of_segments): for index in range(num_of_segments):
points.append(get_angle_point(a1 + angle_segment * (index + 1))) points.append(get_angle_point(a1 + angle_segment * (index + 1)))
......
...@@ -155,7 +155,7 @@ class URIHandler(object): ...@@ -155,7 +155,7 @@ class URIHandler(object):
def open(self): def open(self):
if self.is_local(): if self.is_local():
return open(self.get_local_path()) return open(self.get_local_path(), "rb")
else: else:
return urllib.urlopen(self._uri.geturl()) return urllib.urlopen(self._uri.geturl())
......
<?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="210mm"
height="297mm"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Neues Dokument 1">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="350"
inkscape:cy="98.654603"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1440"
inkscape:window-height="858"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<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>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:17.71653557;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 0,822.04724 0,230.31496 354.33071,0 0,-230.31496 -354.33071,0 z m 97.442507,88.56346 c 24.462693,0 44.283523,19.85127 44.283523,44.31298 0,24.46169 -19.82083,44.28173 -44.283523,44.28173 -24.462677,0 -44.283525,-19.82004 -44.283525,-44.28173 0,-24.46171 19.820848,-44.31298 44.283525,-44.31298 z m 159.445693,0 c 24.4627,0 44.31478,19.85127 44.31478,44.31298 0,24.46169 -19.85208,44.28173 -44.31478,44.28173 -24.46268,0 -44.28352,-19.82004 -44.28352,-44.28173 0,-24.46171 19.82084,-44.31298 44.28352,-44.31298 z"
id="path3830"
inkscape:connector-curvature="0" />
</g>
</svg>
application/sla; pycam '%s'; description="Stereo Lithographic File"; test=test -n "$DISPLAY"; nametemplate=%s.stl application/sla; pycam '%s'; description="Stereo Lithographic File"; test=test -n "$DISPLAY"; nametemplate=%s.stl
image/vnd.dxf; pycam '%s'; description="Drawing Interchange File"; test=test -n "$DISPLAY"; nametemplate=%s.dxf image/vnd.dxf; pycam '%s'; description="Drawing Interchange File"; test=test -n "$DISPLAY"; nametemplate=%s.dxf
image/svg+xml; pycam '%s'; description="Vector Graphics"; test=test -n "$DISPLAY" && which inkscape && which pstoedit; nametemplate=%s.svg image/svg+xml; pycam '%s'; description="Vector Graphics"; test=test -n "$DISPLAY" && which inkscape pstoedit >/dev/null; nametemplate=%s.svg
application/postscript; pycam '%s'; description="Postscript"; test=test -n "$DISPLAY" && which pstoedit application/postscript; pycam '%s'; description="Postscript"; test=test -n "$DISPLAY" && which pstoedit >/dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment