org.rajawali3d.curves

Package org.rajawali3d.curves

Types

ArchimedeanSpiral3D

open class ArchimedeanSpiral3D : ASpiral3D
open class ArchimedeanSpiral3D : ASpiral3D

ICurve3D spiral implementation following an Archimedean spiral. Special values of the density parameter result in special conditions:

ASpiral3D

abstract class ASpiral3D : ICurve3D
abstract class ASpiral3D : ICurve3D

CatmullRomCurve3D

open class CatmullRomCurve3D : ICurve3D
open class CatmullRomCurve3D : ICurve3D

Derived from http://www.cse.unsw.edu.au/~lambert/splines/source.html

CompoundCurve3D

open class CompoundCurve3D : ICurve3D
open class CompoundCurve3D : ICurve3D

CubicBezierCurve3D

open class CubicBezierCurve3D : ICurve3D
open class CubicBezierCurve3D : ICurve3D

ICurve3D

interface ICurve3D
interface ICurve3D

ICurve4D

interface ICurve4D
interface ICurve4D

LinearBezierCurve3D

open class LinearBezierCurve3D : ICurve3D
open class LinearBezierCurve3D : ICurve3D

LogarithmicSpiral3D

open class LogarithmicSpiral3D : ASpiral3D
open class LogarithmicSpiral3D : ASpiral3D

ICurve3D spiral implementation following a Logarithmic spiral, also known as the Golden Spiral, or Nautilus curve.

Path3D

open class Path3D : ICurve3D
open class Path3D : ICurve3D

Path4D

open class Path4D : ICurve4D
open class Path4D : ICurve4D

QuadraticBezierCurve3D

open class QuadraticBezierCurve3D : ICurve3D
open class QuadraticBezierCurve3D : ICurve3D

SVGPath

open class SVGPath
open class SVGPath

Parses a path from an SVG string. Please bear in mind that this is not a full XML parser. This is also an incomplete implementation. If you encounter anything that's missing please post an issue on Github and we'll add whatever you're after. What you can use is either a path String:


  String path = "M22.395-127.223c-4.492,11.344-4.688,33.75,0,44.883" +
  	"c-11.328-4.492-33.656-4.579-44.789,0.109c4.491-11.354,4.688-33.75,0-44.892" +
  	"C-11.066-122.63,11.262-122.536,22.395-127.223z";
  
  SVGPath svgPath = new SVGPath();
  List paths = svgPath.parseString(path);
  
Or you could use a string resource from the "raw" folder:

  SVGPath svgPath = new SVGPath();
  List paths = svgPath.parseResourceString(mContext, R.raw.lavatories_svg_path);
  
To draw a path:

  for(int i=0; i points = new Stack();
  	int subdiv = 1000;
  	for(int j=0; j<=subdiv; j++)
  	{
  		points.add(subPath.calculatePoint(j / subdiv));
  	}
  	pathPoints.add(points);
  	Line3D line = new Line3D(points, 1);
  	SimpleMaterial material = new SimpleMaterial();
  	material.setUseSingleColor(true);
  	line.setMaterial(material);
 	getCurrentScene().addChild(line);
  }