Exemple #1
0
        cam.brush_reload_dwell = self.options.brush_dwell
        cam.brush_trail_down = self.options.brush_trail_down
        cam.brush_depth = self.options.brush_depth
        cam.brush_overshoot = cam.brush_trail_down + cam.tool_width/2
        cam.use_fillets = not self.options.brush_no_fillets
        cam.close_polygons = self.options.brush_close_polygons
        #cam.fillet_radius = cam.tool_width / 2
        if self.options.brushstroke_max > 0.0:
            cam.feed_interval = self.options.brushstroke_max
            cam.brush_flip_before_reload = True
        
        cam.generate_gcode(cutpath_list, cam.brush_depth)
        return cam
        
option_info = [
    supereffect.optargs('--active-tab', type='string', dest='active_tab'),
    
    supereffect.optargs('--origin-ref', dest='origin_ref', default='paper', help='Lower left origin reference.'),
    supereffect.optargs('--sort-paths', type='inkbool', dest='sort_paths', default=True, help='Sort paths to minimize rapid moves.'),
    supereffect.optargs('--biarc-tolerance', type='float', convert_to='world', default=0.01, help='Biarc approximation fitting tolerance.'),                
    supereffect.optargs('--biarc-max-depth', type='int', default=4, help='Biarc approximation maximum curve splitting recursion depth.'),                
    supereffect.optargs('--line-flatness', type='float', convert_to='world', default=0.001, help='Curve to line flatness.'),                
    supereffect.optargs('--min-arc-radius', type='float', convert_to='world', default=0.01, help='All arcs having radius less than minimum will be considered as straight line.'),
    supereffect.optargs('--epsilon', type='float', convert_to='world', default=0.0001, help='Epsilon'),

    supereffect.optargs('--z-scale', type='float', dest='z_scale', default=1.0, help='Scale factor Z'), 
    supereffect.optargs('--z-offset', type='float', convert_to='world', default=0.0, help='Offset along Z'),
    supereffect.optargs('--x-scale', type='float', dest='x_scale', default=1.0, help='Scale factor X'), 
    supereffect.optargs('--x-offset', type='float', convert_to='world', default=0.0, help='Offset along X'),
    supereffect.optargs('--y-scale', type='float', dest='y_scale', default=1.0, help='Scale factor Y'), 
    supereffect.optargs('--y-offset', type='float', convert_to='world', default=0.0, help='Offset along Y'),
Exemple #2
0
    
    _number = 0
    def _draw_number(self, vertices):
        centroid = self._polygon_centroid(vertices)
        attrs = {'x': str(centroid.x), 'y': str(centroid.y),
                 inkex.addNS('space','xml'): 'preserve',
                 'style': 'font-size:24px;font-family:Sans;fill:#000000'}
        #inkex.addNS('space','xml'): 'preserve'
        t = inkex.etree.SubElement(self.polygon_layers[0], inkex.addNS('text', 'svg'), attrs)
        attrs = {'x': str(centroid.x), 'y': str(centroid.y), inkex.addNS('role','sodipodi'):'line'}
        span = inkex.etree.SubElement(t, inkex.addNS('tspan', 'svg'), attrs)
        span.text = str(self._number)
        self._number += 1

option_info = (
    supereffect.optargs('--active-tab',),
    
    supereffect.optargs('--scale', '-s', type='float', default=1.0, help='Output scale.'),
    supereffect.optargs('--rotate', '-r', type='float', convert_to='rad', default=0.0, help='Rotation.'),
#    supereffect.optargs('--flip', '-F', type='inkbool', default=False, help='Flip by 90 deg.'),
    supereffect.optargs('--symmetry', '-S', type='int', default=5, help='Degrees of symmetry.'),
    supereffect.optargs('--numlines', '-n', type='int', default=30, help='Number of lines.'),
    supereffect.optargs('--mid-skinny', '-M', type='int', default=1, help='Midpoint type for skinny diamonds.'),
    supereffect.optargs('--mid-fat', '-N', type='int', default=1, help='Midpoint type for fat diamonds.'),
    supereffect.optargs('--skinnyfat-ratio', type='float', default=0.2, help='Skinny/fat ratio'),
    supereffect.optargs('--segment-ratio', type='float', default=0.5, help='Segment ratio'),
    supereffect.optargs('--offset-x', type='float', convert_to='world', default=0.0, help='X offset'),
    supereffect.optargs('--offset-y', type='float', convert_to='world', default=0.0, help='Y offset'),
    supereffect.optargs('--salt-x', type='float', default=0.1132, help='X offset salt'),
    supereffect.optargs('--salt-y', type='float', default=0.2137, help='Y offset salt'),
    supereffect.optargs('--epsilon', type='float', default=0.0001, help='Epsilon'),