Git Product home page Git Product logo

lineplz's Introduction

lineplz

An experiment to render vector art using adaptively sampled distance. Inspired by the paper "Adaptively Sampled Distance Fields: A general representation of Shape for Computer Graphcs" by Sarah F. Frisken et all.

There's not much to document, it's a personal experiment. The interesting part is the adaptive sampling of distance fields in 2D using a quadtree - mainly because how elegant the solution is (not because how fast it is).

This is not intended for booleans or any other fancy stuff. Each primitive is rendered to it's own "layer". The really cool thing about distance function is that you can trivially tune the smoothing function on a border to your hearts content. The adaptively sampled quadtree is implemented in https://github.com/mkuitune/lineplz/blob/main/lnpz/lnpz_fieldquadtree.h and https://github.com/mkuitune/lineplz/blob/main/lnpz/lnpz_fieldquadtree.cpp.

samples/lnpz-samples.cpp is the main driver code for the existing test scenes. samples/ contains also some results of render tests such as A sample rendering

Instructions

It's a cmake project with no external dependencies. You need a C++ compiler and CMake... Tested on Visual Studio, other compilers may or may not work.

This includes Clipper2, nlohmann::json and stb libraries as bundled dependencies.

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.