#3d #mesh-generation #gamedev #library #c #utilities #libraries

prideout c79fcfddef triangle: add par_triangle__in_circle. 9 سال پیش
test b78fb75006 triangle: add new test case. 9 سال پیش
tools 0916c9b552 triangle: implement par_triangle__mesh_subdivide. 9 سال پیش
.gitignore 3ef6d18fe8 Fleshing out par_shapes. 10 سال پیش
.travis.yml 4d3ec05e73 Skeleton for sweep-and-prune library. 10 سال پیش
README.md 3c660b0599 Add easings to the README. 10 سال پیش
par_bluenoise.h 4258160579 Add back the subdomain. 10 سال پیش
par_bubbles.h fc177a483d bubbles: update the API summary to include recent work on deep zoom. 9 سال پیش
par_easings.h 899223d3cc easings: add PAR_PI block. 10 سال پیش
par_easycurl.h fef1f41f8c Fix header guards. 10 سال پیش
par_filecache.h d66555ee75 Fix Xcode warning. 10 سال پیش
par_msquares.h 4258160579 Add back the subdomain. 10 سال پیش
par_shapes.h ea5722a13d Fix division by zero in par_shapes_weld. 10 سال پیش
par_sprune.h b4d45ce7df triangle: implement par_triangle__mesh_remove. 9 سال پیش
par_triangle.h c79fcfddef triangle: add par_triangle__in_circle. 9 سال پیش

README.md

Build Status

par

Single-file C libraries under the MIT license. Documentation can be found at the top of each header file, but some libraries have an accompanying blog post.

library description link
par_msquares.h efficient marching squares implementation blog post
par_shapes.h generate parametric surfaces and other simple shapes blog post
par_bubbles.h pack circles into hierarchical diagrams blog post
par_bluenoise.h generate progressive 2D point sequences blog post
par_sprune.h efficient broad-phase collision detection in 2D web demo
par_easycurl.h simple HTTP requests using libcurl
par_filecache.h LRU caching on your device's filesystem
par_easings.h Robert Penner's easing functions

tests

To run tests, you need CMake and libcurl. On OS X, these can be installed with homebrew:

$ brew install cmake pkg-config curl

Here's how you can tell CMake to use the CMakeLists in the test folder, placing all the messy stuff in a new folder called build.

$ cmake test -Bbuild   # Create makefiles
$ cmake --build build  # Invoke the build

The tests are executed by simply running the programs:

$ cd build
$ ./test_msquares
$ ./test_bluenoise
$ ./test_bubbles
$ ./test_shapes

code formatting

This library's code style is strictly enforced to be vertically dense (no consecutive newlines) and horizontally narrow (80 columns or less).

The tools/format.py script invokes a two-step code formatting process:

  1. Runs uncrustify with our custom configuration. This auto-formats all code in the root folder, up to a point. For example, it does not enforce the 80-character line constraint because line breaking is best done by a human.
  2. Checks for violations that are not otherwise enforced with uncrustify.

The aforementioned Python script is also invoked from Travis, but using the --check option, which checks for conformance without editing the code.

Beyond what our uncrustify configuration enforces, the Python script does the following:

  • Checks that no lines are more than 80 chars.
  • Checks for extra newlines before an end brace.