P2R (Processing to Racket) is an implementation of the Processing programming language for Racket that allows architects and designers to use Processing with their favourite CAD application.
Before installing P2R, you will need to have Racket.
You can install P2R from DrRacket's Install Package dialog box with git://github.com/hfcorreia/p2r
as the package source.
Alternatively, you can install it with the raco
tool by running:
raco pkg install git://github.com/hfcorreia/p2r
You can update the currently installed version with DrRacket's Package Manager, or alternatively with the following raco command:
raco pkg update p2r
At the moment P2R implements Processing's basic primitive types and control flow structures. P2R uses the Rosetta library to have a rendering environment, allowing to use Processing with CAD applications (such as AutoCAD ou Rhinoceros 3D). Many of Rosetta drawing operations and capabilities were mapped to Processing.
To use P2R with Racket, simply replace #lang racket
with #lang processing
.
Check the examples for some ideas of how to use P2R.
- Processing's object system and exceptions
- Map Processing's runtime and primitives to Racket's
Importing Rosetta in our implementation generates a cannot instantiate 'racket/gui/base' a second time in the same process
warning which breaks DrRacket arrow/binding traking.
This work was partially supported by national funds through Fundação para a Ciência e a Tecnologia (FCT) with reference UID/CEC/50021/2013, and by the Rosetta project under contract PTDC/ATP-AQI/5224/2012.