Giter VIP home page Giter VIP logo

kokopelli's Introduction

kokopelli is deprecated

Its successors are Antimony and Ao.


About

kokopelli is an open-source tool for computer-aided design and manufacturing (CAD/CAM).

It uses Python as a hardware description language for solid models. A set of core libraries define common shapes and transforms, but users are free to extend their designs with their own definitions.

CAD

The CAM tools enable path planning for two, three, and five-axis machines. At the moment, paths can be exported to Universal and Epilog laser cutters, the Roland Modela mini-mill, three and five-axis Shopbot machines, and plain G-code. A modular workflow system makes adding new machines easy.

CAM

In addition, models can be saved as .svg and water-tight .stl files.

Warning

kokopelli stores designs as Python scripts and executes them. This means that you can do cool things like using numpy to process arrays, load and process images with PIL, or even scrape web data and use it to inform designs.

However, it also means that bad actors can write malicious scripts.

As such, do not open a .ko file from an untrusted source without first examining it in a text editor to confirm that it is not malicious.

Download

kokopelli has been tested on Mac OS 10.6+ and Ubuntu 12.04 LTS.
A Mac application is available here.
To build from source, check out the instructions on the wiki.

Background

kokopelli grew out of the MIT course "How to Make Something that Makes (Almost) Anything". In that course, I worked on fast geometry solvers and developed a fairly basic UI. My work expanded on the fab modules project, which allows fab lab users to make physical artifacts on a variety of machines.

This work grew into my Master's thesis at the MIT Center for Bits and Atoms. This thesis focused on volumetric CAD/CAM workflows. Now that it is complete, I'm releasing this tool for others to use and develop. It has already been used by folks in How to Make (Almost) Anything and Fab Academy, but I'm excited to offer it to a larger community.

Copyright

(c) 2012-2013 Massachusetts Institute of Technology
(c) 2013 Matt Keeter

kokopelli's People

Contributors

mkeeter avatar tytouf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kokopelli's Issues

Question: Retro mode

Hi Matt, will kokopelli have some sort of retro/compatibility mode so that we wan continue designing .cad circuit boards with it?

Thanks

Mac version seems to be missing libraries

When trying to open examples/fab_ISP.ko, i get the following error in output:

####       Rendering image      ####
>>  Compiling to math file
Traceback (most recent call last):
ImportError: No module named pcb

I assume this is due to the fact that the pcb library is not included in the a Mac app, but there is no apparent way to import it.

Kokopelli fails to load

Hi Matt

I am having some trouble getting the Kokopelli software to run. I am running Ubuntu, specifically, the Xubuntu 16.4 flavour.

I am following the instructions on the wiki. I have installed the dependencies as shown on the install page. I have run make in the top-level directory. When I run ./kokopelli in the terminal, I get the following error:

nathan@NathanStasinAcer:~/Desktop/CNC/kokopelli$ ./kokopelli
[|||||||---] importing koko.glcanvas
Traceback (most recent call last):
File "./kokopelli", line 64, in
from koko.app import App
File "/home/nathan/Desktop/CNC/kokopelli/koko/app.py", line 22, in
from koko.frame import MainFrame
File "/home/nathan/Desktop/CNC/kokopelli/koko/frame.py", line 16, in
from koko.glcanvas import GLCanvas
File "/home/nathan/Desktop/CNC/kokopelli/koko/glcanvas.py", line 18, in
from OpenGL.GL import *
File "/usr/lib/python2.7/dist-packages/OpenGL/GL/init.py", line 3, in
from OpenGL.GL.VERSION.GL_1_1 import *
File "/usr/lib/python2.7/dist-packages/OpenGL/GL/VERSION/GL_1_1.py", line 10, in
from OpenGL import platform, constants, constant, arrays
File "/usr/lib/python2.7/dist-packages/OpenGL/arrays/init.py", line 19, in
from OpenGL.arrays.arraydatatype import *
File "/usr/lib/python2.7/dist-packages/OpenGL/arrays/arraydatatype.py", line 14, in
from OpenGL_accelerate.arraydatatype import ArrayDatatype as ADT
File "arraydatatype.pyx", line 1, in init OpenGL_accelerate.arraydatatype (src/arraydatatype.c:10964)
File "wrapper.pyx", line 3, in init OpenGL_accelerate.wrapper (src/wrapper.c:11183)
File "/usr/lib/python2.7/dist-packages/OpenGL/error.py", line 224, in
ErrorChecker = _ErrorChecker( platform )
File "errorchecker.pyx", line 17, in OpenGL_accelerate.errorchecker._ErrorChecker.init (src/errorchecker.c:818)
TypeError: init() takes at least 2 positional arguments (1 given)

Do you have any idea what the problem could be?

Kokopelli does not launch on OSX 10.11.6

with this error in console.

18/11/2016 17:03:53,911 Finder[427]: *** -[__NSArrayI objectAtIndex:]: index 3 beyond bounds [0 .. 2]
18/11/2016 17:03:53,913 Finder[427]: (
0 CoreFoundation 0x00007fff98861452 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff8813c73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff98781094 -[__NSArrayI objectAtIndex:] + 164
3 XtraFinder 0x00000001097244ef -[XFFitColumnWidthPlugin fitColumnsOfColumnView:] + 120
4 Foundation 0x00007fff979a4b4e __NSFireDelayedPerform + 377
5 CoreFoundation 0x00007fff987deaf4 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
6 CoreFoundation 0x00007fff987de783 __CFRunLoopDoTimer + 1075
7 CoreFoundation 0x00007fff987de2da __CFRunLoopDoTimers + 298
8 CoreFoundation 0x00007fff987d57d1 __CFRunLoopRun + 1841
9 CoreFoundation 0x00007fff987d4e38 CFRunLoopRunSpecific + 296
10 HIToolbox 0x00007fff96605935 RunCurrentEventLoopInMode + 235
11 HIToolbox 0x00007fff9660576f ReceiveNextEventCommon + 432
12 HIToolbox 0x00007fff966055af _BlockUntilNextEventMatchingListInModeWithFilter + 71
13 AppKit 0x00007fff99300df6 _DPSNextEvent + 1067
14 AppKit 0x00007fff99300226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
15 AppKit 0x00007fff992f4d80 -[NSApplication run] + 682
16 AppKit 0x00007fff992be368 NSApplicationMain + 1176
17 Finder 0x0000000104a458d8 Finder + 22744
18 libdyld.dylib 0x00007fff8a2205ad start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
18/11/2016 17:03:54,311 com.apple.xpc.launchd[1]: (org.pythonmac.unspecified.kokopelli.134432[22818]) Service exited with abnormal code: 1

How to improve rendering

Hi, is there anything I can do to make the rendering look better? Using the shaded or normals shading modes always looks like it's missing parts of the model. The rendering changes with any modifications to the code (including removing a blank line, for example), but it never seems to be without problems. Is there something I'm missing or is it just meant to be a rough approximation of the model? The attached image is a rendering of this code:

from koko.lib.shapes import *
c = cube(0,1,0,1,0,1)
cad.shape = c

image

gear.ko issue

Hi Matt, we are trying to figure out an issue with gear.ko example. If you try to raise the number of teeth, say to 150, then the teeth appear unevenly divided, grouped in 2 to 3 teeth with some space between them.

Do you have any idea of why is this happening?

Thank you

Francisco

PCB library. Rotating a component does not rotate the pin_labels

Hi Matt,

We are trying to figure out how to rotare the pin_labels, we tryed modifying the pin_labels property but there is something we are missing.

class Component(object):
''' Generic PCB component.
'''
def init(self, x, y, rot=0, name=''):
''' Constructs a Component object
x X position
y Y position
rotation angle (degrees)
name String
'''
self.x = x
self.y = y
self.rot = rot

    self.name = name

def __getitem__(self, i):
    if isinstance(i, str):
        try:
            pin = [p for p in self.pins if p.name == i][0]
        except IndexError:
            raise IndexError("No pin with name %s" % i)
    elif isinstance(i, int):
        try:
            pin = self.pins[i-1]
        except IndexError:
            raise IndexError("Pin %i is not in array" %i)
    return BoundPin(pin, self)

@property
def pads(self):
    pads = reduce(operator.add, [p.pad for p in self.pins])
    return s2d.move(s2d.rotate(pads, self.rot), self.x, self.y)

@property
def pin_labels(self):
    L = []
    for p in self.pins:
        p = BoundPin(p, self)
        if p.pin.name:
            L.append(text(p.pin.name, p.x, p.y, 0.03))
    pin_labels=reduce(operator.add, L) if L else None
    return s2d.rotate(pin_labels,self.rot)  #this raises error 'NoneType' object has no attribute 'map'

@property
def label(self):
    return text(self.name, self.x, self.y, 0.03)

kokopelli crash on displaying box example

kokopelli crash on displaying the box.ko example, the program didn't stop but the rendering is stopped, on the terminal there are many of these errors (all the same and filling the line buffer so i can't report you anything but this error).

Traceback (most recent call last):
File "/home/carlo-m/CNC/kokopelli/koko/glcanvas.py", line 150, in evt_paint
self.draw(shader)
File "/home/carlo-m/CNC/kokopelli/koko/glcanvas.py", line 566, in draw
self.draw_mesh(shader)
File "/home/carlo-m/CNC/kokopelli/koko/glcanvas.py", line 591, in draw_mesh
glPushMatrix()
File "errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src/errorchecker.c:1218)
OpenGL.error.GLError: GLError(
err = 1283,
description = 'stack overflow',
baseOperation = glPushMatrix,
cArguments = ()
)

Do you need some other infos, I'm using debian jessie.

Many thanks for your work

Carlo D.

Kokopelli crashes on svg export

The file below reliably causes kokopelli to crash when you try to export to sag. I've downloaded and built the most recent sources on my Mac (Mac OS 10.9.2) and I get the following error:

python(81590,0x11bcc9000) malloc: *** error for object 0x7fe1aac86ef0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

This is a reduced version of the file narrowing down the error. Removing the final 'slot' (slotl2) in the file below or adjusting the width of the 'slot' makes the export work.

============ .ko file ==============


# Build all parts centered on origin unless otherwise stated

from koko.lib.shapes import *
from math import sqrt

# One cad unit is 1mm
cad.mm_per_unit = 1

# Sizes for 12mm ply on shopbot with 6mm downcut tool
material_thickness = 12 # 12mm ply, measures as 11.6mm to 12mm
initial_material_thickness = material_thickness
tool_size = 6

scale = 50 #one castle unit is 5cm

wall_height = 2*scale
wall_width = 7*scale

tab_height = wall_height/2 # tab should be 10mm high
initial_tab_height = tab_height
tab_width = material_thickness #scale/2

wall = rectangle(-(wall_width/2), wall_width/2, -wall_height/2, wall_height/2)



tab = rectangle(0,tab_width, -(tab_height/2),tab_height/2)
dog = circle(0,0, tool_size/2)
dog_offset = tool_size/3

# tab sticking out of left side
wall += move(tab, -((wall_width/2) + (tab_width)), 0)
wall -= move(dog, -((wall_width/2)+dog_offset), -((tab_height/2)+dog_offset))
wall -= move(dog, -((wall_width/2)+dog_offset), ((tab_height/2)+dog_offset))

# tab inset into right side
#wall -= move(tab, (wall_width/2)-tab_width, 0)
#wall -= move(dog, ((wall_width/2)-tab_width+dog_offset), -((tab_height/2)-dog_offset))
#wall -= move(dog, ((wall_width/2)-tab_width+dog_offset), ((tab_height/2)-dog_offset))

#
# reduce slot width
#

# l2 - exact - 0.4mm width
#material_thickness = initial_material_thickness - 0.4
material_thickness = initial_material_thickness - 0.4
slotl2 = rectangle(-(material_thickness/2), material_thickness/2, -(tab_height/2),tab_height/2)
slotl2 += move(dog, -((material_thickness/2)-dog_offset), -((tab_height/2)-dog_offset))
slotl2 += move(dog, -((material_thickness/2)-dog_offset), ((tab_height/2)-dog_offset))
slotl2 += move(dog, ((material_thickness/2)-dog_offset), -((tab_height/2)-dog_offset))
slotl2 += move(dog, ((material_thickness/2)-dog_offset), ((tab_height/2)-dog_offset))
wall -= move(slotl2, -(initial_material_thickness*6), 0)


cad.shape = wall




problem starting current version

[||||||||||]    starting...                                                     
Traceback (most recent call last):
  File "/usr/local/bin/kokopelli", line 61, in <module>
    app = App()
  File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7981, in __init__
    self._BootstrapApp()
   File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7555, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/usr/local/bin/koko/app.py", line 74, in OnInit
    koko.FRAME = MainFrame(self)
  File "/usr/local/bin/koko/frame.py", line 95, in __init__
    self._hint = wx.lib.stattext.GenStaticText(self)
TypeError: __init__() takes at least 4 arguments (2 given)

Switch to a standard OSI License

I've been playing with kokopelli and have been very intrigued. I've been very happy to use it for hobby purposes.

I'd like to pitch using it for a work project however without a standard license it will be very hard to pitch. Would you consider switching to one of the standard OSI approved licenses such as Apache, BSD, or MIT?

OSI Approved Licenses: http://opensource.org/licenses

Crash when loading a .stl file

The application crashes when loading a .stl file.

I connected gdb and it looks like the mesh->tdata and mesh->vdata are not correctly allocated when loading the .stl file.

Changing line 24 in libfab/formats/stl.c:
mesh_reserve_v(mesh, mesh->vcount_3);
with
mesh_reserve_v(mesh, mesh->tcount_3);
prevent the crash but then it does not seem to work correctly as my object is not displayed.

PCB Size and border

Hi Matt, in the FabISP example, if you try to change the width of the board say from 0.805 to 1.805 it exports the same png image, does not change the size of the exported image. And also I have a question about the borders. The Layout and Traces export image used to have a white border around it. I haven't milled any board with the new kokopelli so far but there is no white border in the traces now. The cutout export has the black border around it but not the same size in top/bottom than in the left/right side (which is narrower). Is it OK like this? Thank you

Francisco

cant start on linux mint maya (ubuntu 12.04)

hello
I try to run kokopelli but the window open and close immediatly with an error :

ctypes.ArgumentError: ("argument 4: <type 'exceptions.TypeError'>: No array-type handler for type <class 'OpenGL.converters.c_int_Array_1'> (value: <OpenGL.converters.c_int_Array_1 object at 0x2be4e) registered", (3L, 1, <OpenGL.converters.c_char_p_Array_1 object at 0x2be4dd0>, <OpenGL.converters.c_int_Array_1 object at 0x2be4ef0>))

note that I installed all the dependancies

crashes on startup with 'module' object has no attribute 'sizeof'

After installing and building from source on Ubuntu 13.04, running it gets me the following error:

importing koko.glcanvasNo handlers could be found for logger "OpenGL.arrays.numpymodule"

Traceback (most recent call last):
  File "/usr/local/bin/kokopelli", line 64, in <module>
    from koko.app import App
  File "/usr/local/bin/koko/app.py", line 22, in <module>
    from   koko.frame       import MainFrame
  File "/usr/local/bin/koko/frame.py", line 16, in <module>
    from    koko.glcanvas  import GLCanvas
  File "/usr/local/bin/koko/glcanvas.py", line 18, in <module>
    from OpenGL.GL      import *
  File "/usr/lib/python2.7/dist-packages/OpenGL/GL/__init__.py", line 3, in <module>
    from OpenGL.raw.GL.annotations import *
  File "/usr/lib/python2.7/dist-packages/OpenGL/raw/GL/annotations.py", line 40, in <module>
    'v',
  File "/usr/lib/python2.7/dist-packages/OpenGL/arrays/arrayhelpers.py", line 177, in setInputArraySizeType
    function.setPyConverter( argName, asArrayTypeSize(type, size) )
  File "arraydatatype.pyx", line 393, in OpenGL_accelerate.arraydatatype.AsArrayTypedSizeChecked.__init__ (src/arraydatatype.c:7688)
AttributeError: 'module' object has no attribute 'sizeof'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.