Giter VIP home page Giter VIP logo

cl-lsystem's Introduction

My CV sources

Netlify Status

Development mode

To start the Figwheel compiler, navigate to the project folder and run the following command in the terminal:

lein figwheel

Figwheel will automatically push cljs changes to the browser. Once Figwheel starts up, you should be able to open the public/index.html page in the browser.

REPL

The project is setup to start nREPL on port 7002 once Figwheel starts. Once you connect to the nREPL, run (cljs) to switch to the ClojureScript REPL.

Building for production

lein clean
lein package

cl-lsystem's People

Contributors

leovalais avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cl-lsystem's Issues

Implement branches as cylinders which axis is the turtle's path

It might require either:

  • changing the format (VRML most likely)
  • perform some 3D geometry to infer the vertices of the faces of the cylinder (of radius R).

I currently think that the most accurate thing to do is to shift the axes to align to the center of the cylinder and draw the centered circle. Finally, these vertices are to be un-shifted to the original (global) axes.

Silent ASDF compiling output

Hide output like:

; compiling file "/cl-lsystem/lsystem.lisp" (written 23 MAY 2019 08:58:10 PM):
; compiling (IN-PACKAGE :CL-LSYSTEM)
; compiling (DEFTYPE PARAMETRIZED-LETTER ...)
; compiling (DEFTYPE PARAMETRIZED-WORD ...)
; compiling (DEFCLASS RULE ...)
; compiling (DEFCLASS LSYSTEM ...)
; compiling (DEFGENERIC SET-RULE ...)
; compiling (DEFUN RULE-OF-PARAMETRIZED-LETTER ...)
; compiling (DEFUN PARAMETRIZED-LETTER->INSTRUCTION ...)
; compiling (DEFUN EXPAND-LETTER ...)
; compiling (DEFUN %ITER-LSYSTEM ...)
; compiling (DEFUN ITER-LSYSTEM ...)
; compiling (DEFPARAMETER *LSYSTEM* ...)
; compiling (DEFMACRO DEFINE-LSYSTEM ...)
; compiling (DEFMACRO DEFINE-RULE ...)
; compiling (DEFMACRO PARAMETRIC-WORD ...)
; compiling (DEFMACRO INSTRUCTION-CONSTRUCTOR ...)
; compiling (SET-DISPATCH-MACRO-CHARACTER #\# ...)
; compiling (SET-DISPATCH-MACRO-CHARACTER #\# ...)

; wrote /root/.cache/common-lisp/sbcl-1.4.13-linux-x64/cl-lsystem/lsystem-tmp5GEXGEG5.fasl
; compilation finished in 0:00:00.051

Fix :initial-orientation for S-exp L-System definitions

Problem

The parameter :initial-orientation which was initially meant to set the turtle's initial directions
introduces bugs in a 3D space when it comes to rotations (cf. turn).
It seems to do some axis shifting.

Proposed solution

Replace it by an :initial-direction parameter which sets the slot direction of turtle directly, instead of playing with rotations.

Replace turn instruction by roll, pitch and yaw

turn accepts a vector which must have only one non-zero coordinate which represents the axis (X, Y or Z) and how much to spin.
It would be better to have three distinct instructions:

  • roll θ
  • pitch θ
  • yaw θ

Improve OBJ vertice storage

The aim is to merge vertices that are close enough to smooth floating point imprecisions.

The list of vertices is read at most once at each insertion and position retrieval. Hence it makes evaluation and exportation each at least O(n^2).

Fix initial direction for 2d-environment

The following code:

(process *plant-f* 7 (let ((env (make-instance 'png-environment :origin (v 0 -950))))
                                   (setf (direction (turtle env))
                                         (v 0.0 1.0))
                                   env) "refactor-plant-f")

generates the image:
hlu-plant-f
which is wrong because the tree should grow following the Y axis instead of X.

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.