Git Product home page Git Product logo

fstwn / cockatoo Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 3.0 52.01 MB

Cockatoo is a prototypical open-source software toolkit for generating (3d-)knitting patterns from NURBS surface and mesh geometry directly inside Grasshopper.

Home Page: https://fstwn.github.io/cockatoo

License: MIT License

Python 58.54% Makefile 0.07% HTML 30.55% CSS 0.35% JavaScript 1.89% Common Lisp 0.33% TeX 7.74% Batchfile 0.06% C# 0.45% Perl 0.01%
knitting cad rhino grasshopper knitting-pattern machine-knitting computerized-knitting-machines grasshopper-components nurbs-surfaces knitting-patterns

cockatoo's Introduction

COCKATOO

Automatic knitting pattern generation using Cockatoo

DOI


Purpose & Origins

The purpose of this project is to enable Rhino and Grasshopper to automatically derive (3d-)knitting patterns for computerized knitting machines from NURBS surfaces and unstructured triangle meshes. The absence of such a freely available open-source toolkit marks the origin point for this project. Programming Cockatoo was only possible thanks to some brilliant research done by lots of other people. Please check the Sources & References section if you're curious.

This open-source software prototype constitutes the practical part of my diploma project Knit Relaxation - Knit Membranes for Textile (Interior) Architecture (original german title: Knit Relaxation - Membrangestricke für Textile (Innen-)Architektur) in the product design department at Kunsthochschule Kassel.

Software Structure

Python Module

  • All datastructures, core logic and algorithms are defined in the cockatoo python module.
  • This module is developed to be compatible with IronPython (for more info, see the Pecularities section).
  • The RhinoCommon API is used to handle all geometric operations.
  • The networkx module is used to handle all the necessary graph operations (for more info, see the Pecularities section).

Rhino Integration

The cockatoo module can be used from within Rhino.Python scripts as well as from within Grasshopper through the GHPython scriptable component.

Grasshopper Components

Cockatoo includes a set of Grasshopper components (UserObjects), which provide a user interface to the underlying python module without the need of scripting.

Extendability

The python module as well as the UserObjects are designed to be open for extension. Everything is open-source.

Pecularities

Development Environment

The RhinoPython and GHPython development environments are very, very special. I am not going to write in-depth about this here. Everybody who is working with these tools on a regular basis should have come accross their oddities. If not - most information about these topics is available in the Rhino Developer Docs.

Graph Library

To do all the juicy graph stuff, Cockatoo uses NetworkX. To be more specific, an older version - NetworkX 1.5 is used for... well, reasons. This specific networkx module was modified in some places and is therefore bundled with Cockatoo! Using a different version might be possible but may also lead to errors.

Partial Dependencies

  • Some of the UserObjects rely on Kangaroo 2. Since this is shipped with Rhino since Version 6, everything should work smoothly. The Kangaroo 2 installation should be found by the UserObjects automagically. If any hiccups occur, please let me know.

  • There is one UserObject that relies on Plankton being installed, although it's just a small utility. If Plankton is already installed everything should be found automagically, otherwise you'd first have to install Plankton. If any hiccups occur with this, please also let me know.

Installation

1. Download release files

  • Go to releases and download the newest release
  • Unzip the downloaded archive. You should get the folders: modules and Cockatoo.

2. Install python modules

  • Open the scripts folder of Rhino 6
    • On Windows: C:\Users\%USERNAME%\AppData\Roaming\McNeel\Rhinoceros\6.0\scripts

    • On Mac OSX: ~/Library/Application Support/McNeel/Rhinoceros/6.0/scripts

  • Move all the Content from inside the modules directory to this scripts folder.

3. Install Cockatoo UserObjects

  • Navigate to the Grasshopper UserObjects folder

    • On Windows: C:\Users\%USERNAME%\AppData\Roaming\Grasshopper\UserObjects

    • On Mac OSX: ~/Library/Application Support/McNeel/Rhinoceros/MacPlugIns/Grasshopper/UserObjects

    • Alternative: Open Rhino & Grasshopper and in the Grasshopper Window click on File > Special Folders > User Object Folder

  • Move the whole Cockatoo directory to the UserObjects folder.

4. Unblock the new UserObjects!

  • Go into the Cockatoo folder inside Grasshoppers UserObjects folder
  • Right click onto the first UserObject and go to Properties
  • If the text This file came from another computer [...] is displayed click on Unblock!
  • Unfortunately you have to do this for EVERY UserObject in the folder!

5. Restart Rhino & Grasshopper

  • If Rhino was running during the installation process, you'll have to restart it for the changes to take effect!

Examples & Usage

If everything is installed correctly, you should be able to open the example file provided in Examples. For a demo, you can also have a look at the demonstration video.

For guidance on using the API provided through the python module directly, please have a look at the documentation

Testing & Contributing

You are invited to participate!

Contributing is easy as Pi (well...easier, actually). First off, Cockatoo needs software testing to find bugs and make it more robust. So just by trying out Cockatoo out of curiosity, you can actually help!

If you find a bug (which is very likely because they always sneak in somewhere) please tell me about it by submitting an issue so I can improve Cockatoo further.

Testing

A sad truth is that I currently don't have access to a computerized knitting machine. As a consequence, it was not possible to actually test or verify a knitting pattern generated by Cockatoo in the real world, yet. If you have access to a machine and you would be willing to collaborate with me in testing, I would be more than happy!

Also, if you know a thing or two about computational knitting and find a fundamental (or minor) mistake in the workings of Cockatoo, please let me know. I'm always eager to learn from others and fix mistakes.

Code

If you're willing to contribute to Cockatoo by writing new code or improving existing code, that's great! Please have a look at the contribution guidelines.

Sources & References

This section states the most important sources used in writing this software. The full and proper list of sources is - of course - available in the written version of the diploma thesis.

Licensing

  • Original code is licensed under the MIT License.
  • NetworkX is licensed under the 3-clause BSD license which can be found in licenses/networkx.
  • Some code snippets from the COMPAS framework are used within this software. This code is licensed under the MIT License which can be found in licenses/COMPAS.
  • Some code snippets by Anders Holden Deleuran are used with permission. They originate from gists and the FAHS pipeline, kindly provided by Anders. This code is licensed under the Apache License 2.0 which can be found in licenses/ahd.

Misc

  • [1] This is a hommage to David Ruttens delightful sense of humor which has changed many of my darker days for the better.

cockatoo's People

Contributors

fstwn 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

Watchers

 avatar  avatar

cockatoo's Issues

seperate mapping network from the real knitting data

don't create weft and warp edges inside the mappingnetwork. instead really use it only for mapping and work on copies of the knitnetwork.
this could make the use of multigraph obsolete for KnitMappingNetwork

handling of tubular meshes

Handling tubular meshes in constraint and network creation should not be too much of a problem:

  • A tubular mesh has exactly two closed loops made up of naked edges
  • A tubular mesh has no self intersections, no valence 3 edges

consistent wording

Review all classes and methods and define a consistent wording to avoid confusion.
A thing should only have one particular name.

PipelineController don't work

Hello
I tried PipelineController but didn't work , can you please make a simple version to only detect changes when geometries added or removed without other settings like layers , colors ...etc

enhance initial weft edge creation

Creation of weft edges called from IWAWE can be optimised a lot:

  • If first all connections between contours with equal number of points are made, all these can be processed in parallel.
  • See Popescu: KnitCrete p. 100 (see sources)

Replace KnitContour routine

KnitContours could be generated using the heat method. I started experimentation on this and the first results seem nice! For the next release there probably will be both versions available.

false connections if geometry is a tubular mesh

Horrible connection failures have been observed on a tubular test mesh.

  • Behaviour seems to occur when creating final warp connections.
  • Behaviour has been observed with ContinuousEnd setting but is not necessarily related.

tubularfail

it should be noted that on a nurbs surface of the same geometry the problem does not occur.
surfacegood

A relation to the difference in generation of KnitContours is possible.

define tests

create standardized test scenarios to test implementation changes

replace include_leaves option in InitializeWeftEdges

include_leaves is not useful as an option. instead something like force_cast_on and force_cast_off should be implemented.
force_cast_on > connects all nodes at pos index 1 to one another (like a second row of leaf nodes at the start)
force_cast_off > connects all nodes at pos index -2 to one another (like a second row of leaf nodes at the end)

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.