|This page contains the design document for an enhancement or feature. The design should be considered a work in progress and may not represent the final design. As this is a collaborative design, contributions and participation from other developers and users is encouraged. Use the discussion page for providing comments and suggestions.|
A solid of revolution can be described by its axis of revolution (point & vector), an angle (-2*pi, 2*pi), and a 2D sketch coplanar with the axis of revolution. The start and end surfaces will be planes, and a positive angle is counterclockwise rotation. There are several options for how to specify the start and end planes. Starseeker suggests using:
In order to analytically solve for the ray/shape intersection points, the sketch must be limited to splines of at most second order.
Questions: Should the sketch be restricted to revolve about its y-axis, or should I allow for an arbitrary point & axis defined in the sketch plane (*2D)? If yes, the sketch would undergo a rotation/translation - is rotation/translation of a sketch already possible? If it is possible, then restricting to the y-axis will not limit the user.
plot() and tess() can be done using the same basic algorithm that the toroids use, with some modifications:
Add support for using a 3D primitive or combination as the basis of the revolve.
This would keep the first half of the primitive or group being revolved at the start plane, and add a copy of the primitive/group to the end. If this was applied to a cone over 90 degrees, where the cross-section used for the revolve was a circle, the result would be a frustum attached to right angle pipe curve, with a cone at the tip.
This would create a partial revolve (angle < 2*pi) with a 3D shape where the maximum outline does not fall in a r-z plane. A 2D example of this is revolving an ellipse with focii at (4,1) and (6, -1) about the z axis. For this case, the minimum radius and maximum radius do not occur along the same plane. If the end cap method (above) was used, there would be an abrubt transition from the ellipse to the revolved body.
This feature can best be implemented by using a sweep along a circular path, becasue the sweep primitive will need to handle this end condition for sweeping any other general 3D primitive. This approach minimizes code duplication, and keeps the revolve primitive focused specifically on revolving.