GithubHelp home page GithubHelp logo

subdivexacteval's Introduction

Exact Evaluation of Catmull-Clark Subdivision limit surface

This repo is a simple implementation of the algorithm implemented by Jos Stam in his paper:

Exact Evaluation of Catmull-Clark Subdivision Surfaces at Arbitrary Parameter Values, Jos Stam, SIGGRAPH 98 Conference Proceedings, Annual Conference Series, July 1998

http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/sig98.pdf

This implementation loads the precomputed eigen structures downloaded from here.

Usage

This is implemented as a C# Class Library project, which when compiled produces a DLL. The evaluation of the limit surface patches can be done by calling the method EigenEvalStructure.EvaluateSurface.

Parameters:
* double[] controlPointCoords: 
Array of 2*N+8 control points where N is the valence of
this patch, sorted in the order described in the Stam's paper. The
coordinates of the control points should be packed into the flat array
in the form - [x1, x2, x3, x4, ... y1, y2, y3, y4, ... z1, z2, z3, z4 ...]
* double[][] uvParams:
This should be a nested array, representing the u,v coordinates of the
points to be evalutated. The inner arrays are expected to be of length 2.
* EvaluationType evalType:
This enumeration tells the function what property to evaluate at the
given parameters. See the documentation of this enumeration for more details.
* double uvTolerance:
This will be used as the minimum value of u and v since the evaluation
at an extraordinary points is not possible (see the paper). If not
supplied, then the default value is used defined as a const member
variable (1e-12).

Return Value:
If the evalType is set to evaluate the position (or tangent or
normal), then a flat array of coordinates of the evaluated points (or
normal vectors or tangent vectors) is returned in the form - [x1, y1,
z1, x2, y2, z2 ...].

The image below shows the results of this method, when tested on an extraordinary patch near the vertex of a cube (valence 3, and visualized in Rhinoceros 6).It shows the points and normals of the patch in green, and the limit surface (generated using the Subdivision command of Rhino) for reference in red.

testImage

Acknowledgements

All thanks to Jos Stam, obviously for the original paper, but also for helping me with some details of this implementation.

subdivexacteval's People

Contributors

ranjeethmahankali avatar

Watchers

James Cloos avatar  avatar

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.