Package geomss.geom.nurbs
Class SurfaceFactory
- java.lang.Object
-
- geomss.geom.nurbs.SurfaceFactory
-
public final class SurfaceFactory extends java.lang.Object
A collection of methods for creating NURBS surfacesModified by: Joseph A. Huwaldt
- Version:
- February 17, 2025
- Author:
- Joseph A. Huwaldt, Date: June 15, 2010
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BasicNurbsSurface
approxPoints(int sDegree, int tDegree, int nS, int nT, PointArray<? extends GeomPoint> points)
Create aNurbsSurface
of the specified degrees that approximates, in a least squares sense, the specified array of geometry points in the input order.static BasicNurbsSurface
createRevolvedSurface(GeomVector<javax.measure.quantity.Dimensionless> axis, NurbsCurve curve)
Create a surface of revolutionNurbsSurface
by sweeping the specified curve about the specified axis.static BasicNurbsSurface
createRevolvedSurface(GeomVector<javax.measure.quantity.Dimensionless> axis, NurbsCurve curve, Parameter<javax.measure.quantity.Angle> theta)
Create a surface of revolutionNurbsSurface
by sweeping the specified curve about the specified axis with the specified curve and angular start and stop values (relative to the curve and axis).static BasicNurbsSurface
createRevolvedSurface(GeomVector<javax.measure.quantity.Dimensionless> axis, NurbsCurve curve, Parameter<javax.measure.quantity.Angle> thetaS, Parameter<javax.measure.quantity.Angle> thetaE)
Create a surface of revolutionNurbsSurface
by sweeping the specified curve about the specified axis with the specified curve and angular start and stop values (relative to the curve and axis).static BasicNurbsSurface
createSkinnedSurface(java.util.List<? extends Curve> crvs, int tDegree, Parameter<javax.measure.quantity.Length> tol)
Create a surface that interpolates, is skinned or lofted, through the input list of curves.static BasicNurbsSurface
createSphere(GeomPoint center, Parameter<javax.measure.quantity.Length> radius)
Create a sphereNurbsSurface
about the specified center point with the specified radius.static BasicNurbsSurface
createTFISurface(Curve s0crv, Curve t0crv, Curve s1crv, Curve t1crv, Parameter<javax.measure.quantity.Length> tol)
Create a Transfinite Interpolation (TFI) NURBS surface, or Coons patch, from the specified boundary curves.static BasicNurbsSurface
createTorus(GeomPoint center, GeomVector<javax.measure.quantity.Dimensionless> axis, Parameter<javax.measure.quantity.Length> innerRadius, Parameter<javax.measure.quantity.Length> outerRadius)
Create a torusNurbsSurface
about the specified center point and axis.static BasicNurbsSurface
fitPoints(int sDegree, int tDegree, PointArray<? extends GeomPoint> points)
Create aNurbsSurface
of the specified degrees that is fit to, interpolates, or passes through the specified array of geometry points in the input order.
-
-
-
Method Detail
-
createSphere
public static BasicNurbsSurface createSphere(GeomPoint center, Parameter<javax.measure.quantity.Length> radius)
Create a sphereNurbsSurface
about the specified center point with the specified radius.- Parameters:
center
- The center of the sphere. May not be null.radius
- The radius of the sphere. May not be null.- Returns:
- A BasicNurbsSurface representing the sphere.
-
createTorus
public static BasicNurbsSurface createTorus(GeomPoint center, GeomVector<javax.measure.quantity.Dimensionless> axis, Parameter<javax.measure.quantity.Length> innerRadius, Parameter<javax.measure.quantity.Length> outerRadius) throws DimensionException
Create a torusNurbsSurface
about the specified center point and axis. The surface will be parameterized such that the "s" direction is around the cross-section of the torus and the t-direction is around the axis.- Parameters:
center
- The center of the torus. May not be null.axis
- The axis to place the torus about. May not be null.innerRadius
- The inner radius of the torus. May not be null.outerRadius
- The outer radius of the torus. May not be null.- Returns:
- A BasicNurbsSurface representing the torus.
- Throws:
DimensionException
-
createRevolvedSurface
public static BasicNurbsSurface createRevolvedSurface(GeomVector<javax.measure.quantity.Dimensionless> axis, NurbsCurve curve) throws DimensionException
Create a surface of revolutionNurbsSurface
by sweeping the specified curve about the specified axis. The surface will be parameterized such that the curve defines the "s" direction and the revolution around the axis is the "t" direction.- Parameters:
axis
- The axis to sweep the curve about (the vector gives direction; use axis.setOrigin() to set a point on the axis). May not be null.curve
- The curve to be revolved around the axis. May not be null.- Returns:
- A BasicNurbsSurface for the input curve revolved around the input axis.
- Throws:
DimensionException
-
createRevolvedSurface
public static BasicNurbsSurface createRevolvedSurface(GeomVector<javax.measure.quantity.Dimensionless> axis, NurbsCurve curve, Parameter<javax.measure.quantity.Angle> theta) throws DimensionException
Create a surface of revolutionNurbsSurface
by sweeping the specified curve about the specified axis with the specified curve and angular start and stop values (relative to the curve and axis). The surface will be parameterized such that the curve defines the "s" direction and the revolution around the axis is the "t" direction.- Parameters:
axis
- The axis to sweep the curve about (the vector gives direction; use axis.setOrigin() to set a point on the axis). May not be null.curve
- The curve to be revolved around the axis. May not be null.theta
- The angle to revolve the curve through (starting at the curve's position). May not be null.- Returns:
- A BasicNurbsSurface for the input curve revolved around the input axis.
- Throws:
DimensionException
-
createRevolvedSurface
public static BasicNurbsSurface createRevolvedSurface(GeomVector<javax.measure.quantity.Dimensionless> axis, NurbsCurve curve, Parameter<javax.measure.quantity.Angle> thetaS, Parameter<javax.measure.quantity.Angle> thetaE) throws DimensionException
Create a surface of revolutionNurbsSurface
by sweeping the specified curve about the specified axis with the specified curve and angular start and stop values (relative to the curve and axis). The surface will be parameterized such that the curve defines the "s" direction and the revolution around the axis is the "t" direction.- Parameters:
axis
- The axis to sweep the curve about (the vector gives direction; use axis.setOrigin() to set a point on the axis). May not be null.curve
- The curve to be revolved around the axis. May not be null.thetaS
- The start angle to revolve the curve through (starting at the curve's position). May not be null.thetaE
- The end angle to revolve the curve through (starting at the curve's position). If the end angle is smaller than the start angle, it is increased by increments of 2*PI until it is larger than the start angle. May not be null.- Returns:
- A BasicNurbsSurface for the input curve revolved around the input axis.
- Throws:
DimensionException
-
createSkinnedSurface
public static BasicNurbsSurface createSkinnedSurface(java.util.List<? extends Curve> crvs, int tDegree, Parameter<javax.measure.quantity.Length> tol)
Create a surface that interpolates, is skinned or lofted, through the input list of curves. This creates a surface in NURBS form that passes through the input list of curves to within the specified tolerance. The degree in the parametric "s" direction (along the input curves) will be determined by the highest degree input curve. The degree in the "t" direction (across the input curves) is specified. If the input curves are all NURBS curves, then the "tol" parameter is ignored. Otherwise, "tol" is used to make a NURBS approximation of the input curves. It is assumed that all the input curves are oriented in an appropriate direction and order to create the desired skinned surface.- Parameters:
crvs
- A list of curves to be skinned. May not be null.tDegree
- The degree in the t-direction of the NURBS surface to create (must be > 0 and < the number of curves in the list).tol
- The greatest possible difference between the input list of curves and the NURBS surface returned. May not be null or zero.- Returns:
- A BasicNurbsSurface that interpolates the input list of curves.
-
createTFISurface
public static BasicNurbsSurface createTFISurface(Curve s0crv, Curve t0crv, Curve s1crv, Curve t1crv, Parameter<javax.measure.quantity.Length> tol) throws java.lang.IllegalArgumentException, ParameterException
Create a Transfinite Interpolation (TFI) NURBS surface, or Coons patch, from the specified boundary curves. This creates a surface in NURBS form that uses the input set of curves as boundaries on all sides to within the specified tolerance. The degree in each parametric dimension will be determined by the highest degree of the input curves. If the input curves are all NURBS curves, then the "tol" parameter is ignored. Otherwise, "tol" is used to make a NURBS approximation of the input curves. It is assumed that all the input curves are oriented in an appropriate direction and order to create the desired TFI surface. The corner points are checked for coincidence.- Parameters:
s0crv
- The curve that represents the s=0 boundary of the TFI surface. May not be null.t0crv
- The curve that represents the t=0 boundary of the TFI surface. May not be null.s1crv
- The curve that represents the s=1 boundary of the TFI surface. May not be null.t1crv
- The curve that represents the t=1 boundary of the TFI surface. May not be null.tol
- The greatest possible difference between the input list of curves and the NURBS surface returned. May not be null or zero.- Returns:
- A BasicNurbsSurface that forms a TFI surface from the input curves.
- Throws:
java.lang.IllegalArgumentException
ParameterException
-
fitPoints
public static BasicNurbsSurface fitPoints(int sDegree, int tDegree, PointArray<? extends GeomPoint> points) throws java.lang.IllegalArgumentException, ParameterException
Create aNurbsSurface
of the specified degrees that is fit to, interpolates, or passes through the specified array of geometry points in the input order. This is a global interpolation of the points, meaning that if one of the input points is moved, it will affect the entire surface, not just the local portion near the point.- Parameters:
sDegree
- The degree in the s-direction (down the strings of points) of the NURBS surface to create (must be > 0 and < the number of points in each string).tDegree
- The degree in the t-direction (across the rows of strings) of the NURBS surface to create (must be > 0 and < the number of strings in the array).points
- The array of GeomPoint objects to pass the surface through: points[col idx][row idx] -> [t][s]. May not be null.- Returns:
- A BasicNurbsSurface fit to the input array of points.
- Throws:
ParameterException
- if there is a problem with the parameterization resulting from fitting a curve through the supplied points.java.lang.IllegalArgumentException
- See Also:
approxPoints(int, int, int, int, geomss.geom.PointArray<? extends geomss.geom.GeomPoint>)
-
approxPoints
public static BasicNurbsSurface approxPoints(int sDegree, int tDegree, int nS, int nT, PointArray<? extends GeomPoint> points) throws java.lang.IllegalArgumentException, ParameterException
Create aNurbsSurface
of the specified degrees that approximates, in a least squares sense, the specified array of geometry points in the input order. This is a global approximation of the points, meaning that if one of the input points is moved, it will affect the entire surface, not just the local portion near the point.- Parameters:
sDegree
- The degree in the s-direction of the NURBS surface to create (must be > 0 and < the number of points in each string).tDegree
- The degree in the t-direction of the NURBS surface to create (must be > 0 and < the number of strings in the array).nS
- The number of surface control points to use in the parametric S direction (must be > 1 and < the number of points in each string).nT
- The number of surface control points to use in the parametric T direction (must be > 1 and < the number of strings in the array).points
- The array of GeomPoint objects approximate a surface through: points[col idx][row idx] -> [t][s]. May not be null.- Returns:
- A BasicNurbsSurface approximating the input array of points.
- Throws:
ParameterException
- if there is a problem with the parameterization that results from approximating the supplied points.java.lang.IllegalArgumentException
- See Also:
fitPoints(int, int, geomss.geom.PointArray<? extends geomss.geom.GeomPoint>)
-
-