Code Monkey home page Code Monkey logo

coffeescad's Introduction

Coffeescad v0_3_preview

THIS PROJECT IS DISCONTINUED !!

While I still love the Coffeescript syntax, I only use ES6/ES2015 these days. If you want an up to date, open source browser based cad, please try OpenJSCAD (https://github.com/jscad)

it is more up to date, and has more features. (I am also an active developper of that project :)

More information about the end of the project: I stopped developing Coffeescad for multiple reasons:

  • when I hit the limitations of Coffeescript vs Javascript when dealing with code tracing, analysis and generation with tools like Esprima, Estraverse, etc: This was going to be used to allow visual<=>code selection & editing (select something in the 3d view to select the code that defines it etc).
  • I have come to dislike 'Object oriented' code more and more over the past few years, leaning more and more towards simple functions, and all the fantastic possibilities AND simplicity of 'functional' programming.
  • Coffeescad was my first serious 'web' based project, things have evolved a lot in the past few years, and so has my knowledge, I would not have made the same choices today

CoffeeSCad

Browser based 3D solid CAD editor, Openscad style, with a Coffeescript based syntax, using only Coffeescript + Javascript

For now it is in an early experimental stage.

You can find:

the old (v0.2) live demo here : http://kaosat-dev.github.com/CoffeeSCad/

the new (v0.3+) live demo here http://coffeescad.net/online/ (this gets regularly updated, and is the final home of CoffeeSCad)

Feedback, bug reports, ideas and contributions are welcome !

Like CoffeeSCad ? Buy me a coffee as they say :)

Flattr this git repo

Status update october 7, 2013

While it may seem that development has slowed down, (commits in this repository), it is far from being the case: I am currently busy with some rather radical changes to CoffeeSCad's kernel and overall structure, and that is taking a bit long : on the menu :

Structure

  • CoffeeSCad is going modular: ie instead of one monolithic application, it will be split up into multiple reusable modules: this means that if you are a developer you could mix and match components and create additional functionality easily , or even create a custom version of CoffeeSCad that fits your needs.

On the features side:

  • support for importing geometry from a LOT of formats (stl, amf, obj etc)
  • support for including both code and geometry from different locations (local, remote via http/https)
  • moving to THREE.js library for not just visual representation
  • support for splines & bezier curves via the above mentionned lib
  • support for different types of extrusion (long overdue)
  • a cleaned up, coherent kernel, that works in the browser , in node.js and on desktop
  • LOTS of optimizations and bugfixes
  • a lot coherent module system (modules are the files containing the code): this not only concerns how things are done internally, but also error reporting, "include" statements etc
  • ground work for slicing integration
  • ground work for material definitions
  • ground work for visual to code and code to visual

And I am surely forgetting a few things !

Given the amount of changes and improvements, this might take a bit to trickle up to the online version, but I am doing my best to keep the wait short !

Cheers !

Important notes regarding browser storage:

Recently github changed their pages domain to ".io" instead of ".com" (https://github.com/blog/1452-new-github-pages-domain-github-io), and since the localstorage system used to store CoffeeSCad's data is based on domain , it made them inaccessible!

The files are salvageable however! Here is how you can get your data back, even if it is a tad complicated

  • you need to find your browser's localstorage folder
  • for google chrome, under linux it is under /home/USERNAME/.config/google-chrome/Local Storage
  • find a file called "http_kaosat-dev.github.com_0.localstorage" (or similar) (note that it has the old github adress)
  • this is an sqlite3 database that you can open (I use http://sqlitebrowser.sourceforge.net/)
  • if you go to "browse data" inside the program above , there is your data :)

This is really clunky, so sorry again.

In the future it would be much better to use the (newer) version of Coffeescad at http://coffeescad.net/online/

That domain will not change so you should be safe, and the newer version also allows you to store data via dropbox as a failsafe.

Contributors

Derrick Oswald Jim Wygralak

Features

  • parametric editing in your browser
  • coffeescript syntax
  • full featured code editor: line counts, syntax coloring, block folding, undo redo etc
  • a limited possibility of "real time" visualisation of the coffeescad code: type your code, watch the shapes changes! this is mainly limited by the speed of your machine and the complexity of the csg objects your are working on: beyond a certain complexity it is not necessarly the best option.
  • automatic bill of materials generation with json export
  • stl export
  • optional online storage using Dropbox

Future Features

  • faster visualization and processing
  • desktop version
  • better ui

Dependencies

These are all included , no need to re-add them

require.js

jquery

underscore.js

backbone.js

backbone.marionette

three.js

coffeescript.js

twitter bootstrap

codemirror

jquery-ui

dropbox-js

Q&A

  • Q : Why CoffeeScript based?

A : For its clear and simple syntax , mostly: even Openscad code can get messy quite fast, so anything that can get rid of a lot of curly braces etc is a good fit

  • Q : Why is it using so many librairies?

A : I have been guilty way too many times of "reinventing the wheel", now I have too little time for that :)

  • Q : The code is changing a lot, can I use it right now?

A : At this stage, this is nothing but an early prototype, so expect things to change , but the overall structure of the app is relatively stable, and I try to keep breaking changes to the scripting itself to a minimum.

  • Q : I am a developper, where is the "meat" of the code ?

A In the dev branch , in the src folder: you have the app and test folder for the app itself and unit tests The app is organized in a logical and modular way:

  • you have the application core (core folder)

  • editors one folder per widget/modular sub app : code editor, visual editor etc

  • exporters one folder per widget/modular sub app for file import/exports only

  • stores one folder per storage type: for now dropbox and browser storage are functionnal

  • Q : Can I try CoffeeScad locally ?

A Sure ! If you want to contribute/play around with newer versions locally you can use the included CakeFile :

  • after installing the depencies : type: "npm install -d" to Install the dependencies from the package.json file
  • on Windows rename the Cakefile.windows to Cakefile: "ren Cakefile Cakefile.linux" and "ren Cakefile.windows Cakefile"
  • you need to first at least copy the template files, just type cake cpTemplates from the root folder or alternatively compile all the files and copy the templates by typing cake build from the root folder
  • just type cake serveWatch from the root folder to watch/compile the files and launch a small webserver
  • you can then go to http://127.0.0.1:8090/ in your browser to use the dev version of CoffeeSCad

Inspiration

  • openscad
  • openjscad (coffeescad was originally based on OpenJSCad but became an independant fork along the way and is not compatible with it anymore)
  • a lot of webgl demos & tutorials
  • a lot more stuff

Disclaimer

I am not a professionnal js/coffeescript dev. And I do this project for fun, learning, and to have an alternative to Openscad that has a few features that I required for various Reprap oriented projects: (and that have been discussed a lot lately in the reprap community)

  • object oriented
  • better code editor (copy, paste, linenumbers etc)
  • etc ?

Licence

MIT licence

coffeescad's People

Contributors

akovalyov avatar derrickoswald avatar joostn avatar kaosat-dev avatar tlrobinson 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  avatar

coffeescad's Issues

Re structure app using better practices and tech

  • app structure: backbone marionnette requirejs, etc, loosely following backbone boilerplate
  • 3d view: threejs
  • tests: jasmine ?

All of this is absolutely required to avoid "complexity" breakdown : we don't wan't the project to become unmanageable right of the bat , now do we ? :)

Add 2d creation tools

These would be very usefull for defining CAG or basic shapes to be extruded etc

  • basic shapes by defining sets of points
  • spline
  • bezier

Perhaps leverage the html5 canvas' 2d capabilities / bezier curves?

Fix panning

Right now , panning , particularly from the top view is not behaving correctly (zoom instead of pan ) in one direction only, needs to be fixed.

Find a way to create a library like system

Absolutely essential in order to be able to re-use design, etc

Some thoughts:

  • "include" /import support
  • multiple files per projects
  • include files/projects from gitsts : to allow for offline work, includes would get "cached" locally as well

Experiment with AR as an assembly helper tool

Only possible after even a basic "step by step assembly" system is implemented, of course.
But it would use augmented reality ,combined with the above, to provide a way to help assemble more complex object IRL
pipe dream?

Fix camera movement issues

Currently

  • camera movements still occur even when mouse events occur outside of the 3d view
  • Zoom does not work in Iceweasel 10 (Firefox)

Add section tools

As in tools usefull to generate section views : should be very easy to do with csg
Ie : define a set of points to define "cutting planes" (see csg.js)

Add "actual" file browser

Right now manipulating the saved projects is clunky as hell, so we need file browser to load, save & delete projects

Add openscad-like hull()

not currently implemented in csg.js, but really essential, will have to look at various existing implementations and examples

Fix recent project list viewing

  • allow user to Limit the number of recent projects on display (as the menu entry in settings would let you think .. :)
  • order them correctly (latest first) : this will require adding a "modification date" field to the projects

farm of nodejs servers

I would like to be able to run the back-end CSG calculations on a farm of nodejs servers, and export the polygons to the client in some way.

This would allow massive generative modelling opportunities.

i am a building architect working with generative modelling and see this tool as perfect for doing that. Sick of Rhino and Grasshopper closed source.

Add options for collaborative editing

This would be collaborative , real time, in browser editing :
This could take on different forms:

  • multiple users edit the same file (part/shape)
  • multiple users can edit the overall assembly, not the same part

Need to be refined

Fix save & load (ui side)

Currently , saving and loading code is present , but not bound correctly to the Ui, so there is not much point in that, is there ? This needs to be done ASAP.

Cylinder doesn't move?

Hi,

I've been trying this Coffeescad and I start to like it.
But I've notice I can't move a cylinder with the 'center' command
The only thing what I can change is put axis in center of Cylinder and put Cylinder on x,y axis
For a cube and other things the center command works except for this cylinder.
It's a bug or it's me?

Define clearly the notions of part & assembly

As this would possibly at the core of Coffeescad :
A few ideas:

  • parts are csg trees as currently used in the editor (or openscad) : a part can be as simple or as complex as needs be
  • assemblies are, obviously made up of parts (+ extra ?)

This is linked with the idea of also being able to generate build instructions , exploded assemblies etc etc
This would also tie in both with #3 and #18

Cannot save ProjectFile(s)

While the whole "library" of projects and projects themselves can be saved, the individual ProjectFile cannot : ie one cannot do a myProjFile.save()

Fix backbone localstorage persistence

Right now, the saving /loading of files does not work at all , and is a mess, this needs to be fixed asap!
(to have it working on the same level as the experimental "store" done previously)

Add finer grain option for csg compiling

Ie : not only "autoUpdate" or lack thereof (generate 3d representation on each code change in the editor)
there needs to be:

  • compile on demand (already in there)
  • compile on code change (already in there)
  • compile on code change + delay (settable delay)
  • compile on save

Fix grid/shadowing issues

Right now, the "plane" on which the shadows get projected is very limited in size, and placed at the wrong height (ie not 0)

Handle edited but unsaved files correctly

  • display the filename with the usual "star" beside its name when it has changed but was not saved
  • if the user wants to create a new file / close the current one and the file is "dirty", ask the user for the usual "you will loose the last 10h of work, do you want to save your file"

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.