Example #1
0
//
// Generate the control points, weights, and knots of a sphere
//
// **params**
// + the center of the sphere
// + normalized axis of sphere
// + vector perpendicular to axis of sphere, starting the rotation of the sphere
// + radius of the sphere
//
// **returns**
// + an object with the following properties: controlPoints, weights, knotsU, knotsV, degreeU, degreeV
//
func SphericalSurface(center *vec3.T, axis, xaxis *vec3.T, radius float64) *verb.NurbsSurface {
	invAxis := axis.Inverted()
	arc := Arc(center, &invAxis, xaxis, radius, 0, math.Pi)

	return RevolvedSurface(arc, center, axis, 2*math.Pi)
}