polyCode
所属分类:内容生成
开发工具:Java
文件大小:244KB
下载次数:0
上传日期:2016-06-20 07:25:02
上 传 者:
sh-1993
说明: 人工智能驱动的编程语言,将图像编译为代码,并将代码编译为图像
(AI driven programming language, compiling images to code and code to images)
文件列表:
.classpath (295, 2016-06-20)
.project (367, 2016-06-20)
.settings (0, 2016-06-20)
.settings\org.eclipse.jdt.core.prefs (587, 2016-06-20)
bin (0, 2016-06-20)
bin\java.policy.applet (141, 2016-06-20)
bin\polyCode (0, 2016-06-20)
bin\polyCode\entities (0, 2016-06-20)
bin\polyCode\entities\Display$1.class (1206, 2016-06-20)
bin\polyCode\entities\Display$2.class (858, 2016-06-20)
bin\polyCode\entities\Display$3.class (1709, 2016-06-20)
bin\polyCode\entities\Display.class (6244, 2016-06-20)
bin\polyCode\entities\DrawPad$1.class (1064, 2016-06-20)
bin\polyCode\entities\DrawPad$2.class (1825, 2016-06-20)
bin\polyCode\entities\DrawPad.class (6762, 2016-06-20)
bin\polyCode\entities\Graph.class (3697, 2016-06-20)
bin\polyCode\entities\Main.class (458, 2016-06-20)
bin\polyCode\entities\Poly.class (13641, 2016-06-20)
bin\polyCode\entities\PolyGraph.class (6330, 2016-06-20)
bin\polyCode\entities\Spline.class (4592, 2016-06-20)
bin\polyCode\handlers (0, 2016-06-20)
bin\polyCode\handlers\Grid.class (3038, 2016-06-20)
bin\polyCode\handlers\Linker.class (3162, 2016-06-20)
bin\polyCode\handlers\PolyHandler.class (9935, 2016-06-20)
bin\polyCode\handlers\PolyPrune.class (3550, 2016-06-20)
bin\polyCode\machine (0, 2016-06-20)
bin\polyCode\machine\Command.class (4896, 2016-06-20)
bin\polyCode\machine\Comparator.class (1555, 2016-06-20)
bin\polyCode\machine\Compiler.class (2313, 2016-06-20)
bin\polyCode\machine\Compressor.class (2687, 2016-06-20)
bin\polyCode\machine\Parser.class (2755, 2016-06-20)
bin\polyCode\machine\Processor.class (4350, 2016-06-20)
bin\polyCode\machine\Variable.class (802, 2016-06-20)
bin\polyCode\main (0, 2016-06-20)
bin\polyCode\main\Main.class (450, 2016-06-20)
bin\polyCode\math (0, 2016-06-20)
bin\polyCode\math\Calculus.class (7798, 2016-06-20)
bin\polyCode\math\CalculusExamples.class (6790, 2016-06-20)
... ...
# polyCode
_AI_ driven programming language, compiling images to code and code to images.
Draw a simple polygon to test; _polyCode_ enforces symmetries in the image, while preserving it's initial structure, employing them for the usage of loops during compilation. Compiled functions are displayed in the terminal, in the form _objectN(posX, posY, rotDeg)_, where N stands for the object's ID. All such functions may be called on.
Objects drawn by the moving _poly_, are compiled in the same manner after detachment by trail-less movement, or change of location (_setLoc(posX, posY)_ call).
###The mathematics
_polyCode_ employs the author's ongoing research on dynamic relational nets in it’s most basic form, where the _pullback-space on one-forms_ and the _vertex-space_ both contain only one element, namely the linear function and the identity operator. This model allows simple modeling of embedded graphs.
By defining appropriate equivalence relations, the set of all isomorphisms is constructed, generating all isomorphic objects under said relations. Thus, constraints may be enforced upon these objects, while preserving their initial structure, as mapped by the isomorphisms.
The interpretation of shape as a distribution is used as a metric of similarity between such objects, allowing further classification within isomorphisms through convergence of characteristic functions.
It employs [javaCalculus](https://github.com/ZigaSajovic/javaCalculus) library developed by the author.
####Built-in commands:
penDown() -> movement leaves a trail
penUp() -> movement is trail-less
move(length) -> translates by length in current direction
rotate(degrees) -> rotates
rename(oldName, newName) -> renames a compiled function
setLoc(posX, posY) -> sets location
setRot(degree) -> sets rotation by degrees
setRot(vecX,vecY) -> sets rotation by direction vector
setColor(color) -> sets drawing color
resetColor() -> resets to default color
setColorVertex(color) -> sets color of vertices
printAll() -> prints all compiled functions
clear() -> clears the terminal
###How to run
Hosted on
_gitHub_ is a pre-prepared _eclipse project_ ready to be imported. Classes are sorted in appropriate pacages for conveniant editing and running.
Hosted on
_dropbox_ is a runnable _.jar_ file.
###Demos
![demoImageToCode2](/demos/demoImageToCode2.gif?raw=true "demoImageToCode2")
![demoImageToCode](/demos/demoImageToCode.gif?raw=true "demoImageToCode")
![demoCodeToImage](/demos/demoCodeToImage.gif?raw=true "demoCodeToImage")
polyCode by
Ziga Sajovic is licensed under a
Creative Commons Attribution 4.0 International License.
近期下载者:
相关文件:
收藏者: