Application Center - Maplesoft

App Preview:

Swept Surface Generator

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

Swept Surface Generator 

 

Dmitry Mikhale, Splinex
Bary Wilson, Splinex
William Spaetzel, Maplesoft
 

Swept Surface Generator Description 

Surfaces of rotation, or swept surfaces, are often used in construction of 3D models or scenes. Sweep tools in many 3D design programs require the user to specify line segments that are then swept about an axis to form the surface. Building complex surfaces  in this manner can can often be cumbersome. Having the ability to mathematically specify surfaces and then to further alter them in scale along a specific axis can greatly speed the creation of multi-component models and scenes.  

 

The piecewise function and plot commands below can be used  to create a variety of complex swept surfaces by specifying the equations for the surface segments instead of specifying a line segment.  The function allows control of up to any number regions along the z axis, each of which can have a different surface shape or contour. The specified surface is then generated using the Maple plot command with cylindrical coordinates.   


For each component along the z-axis you can add another condition to the piecewise function. The length l of each component is determined by the corresponding inequality for that section. The contour and other attributes (e.g., open end / closed end) of each component is determined by the expression following the inequatily.
 

The final length and shape of the plotted surface can also be controlled by specifying the z-values over which the surface is to be plotted. To open the ends of the surface for example, the start plot values should be slightly greater than the segment start value. 

 

Once plotted with nVizx, a variety of nVizx tools can also be used to scale the surface along one or more axes and make other fine modifications as needed. Color, texture, transparency, and lighting can also be added. A call to initiate nVizx from within this Worksheet is included below. If nVizx is installed, the eveluating this section will initiate nVizx and link nVizx to this Worksheet. 

 

As initially set up, the procedure results in the plot of a surface that resembles a stem glass. 

By modifying the expressions as described above, it is possible to quickly generate a wide variety of swept surfaces. 

If one or more of the components along the z-axis is not needed in order to generate the swept surface of interest, the line in the procedure controlling the component(s) not being used can be commented out until needed again. 

 

The plot commands are currently set up to plot each surface in both this Maple Worksheet and nVizx. 

Surfaces generated in nVizx are not automatically erased when the next plot command is initiated. 

 

The Plot Surface Examples section contains an illustrations of surfaces that can be generated with this Worksheet.  

Procedure 

> func:=z->piecewise(
z<0.9,        1-z^3,
z<4, 0.1*sin(Pi*(((z-1))/3))+0.1,
z<4.67,       4*z-15.9-3*(z-4)^2,
   1.4333+.14*sin(z-4.67)
);
 

(Typesetting:-mprintslash)([func := proc (z) options operator, arrow; piecewise(z < .9, 1-z^3, z < 4, .1*sin(Pi*(1/3*z-1/3))+.1, z < 4.67, 4*z-15.9-3*(z-4)^2, 1.4333+.14*sin(z-4.67)) end proc], [proc ...
(Typesetting:-mprintslash)([func := proc (z) options operator, arrow; piecewise(z < .9, 1-z^3, z < 4, .1*sin(Pi*(1/3*z-1/3))+.1, z < 4.67, 4*z-15.9-3*(z-4)^2, 1.4333+.14*sin(z-4.67)) end proc], [proc ...
 

Initializing nVizx 

> with(Spx);
SpxNew();
 

[SpxBringToFront, SpxClear, SpxClearLights, SpxClose, SpxCreateLabel, SpxCreatePointLight, SpxDeleteSelected, SpxExportPolygonal, SpxImportPolygonal, SpxInvertSelection, SpxLoadScene, SpxMakeAction, S...
[SpxBringToFront, SpxClear, SpxClearLights, SpxClose, SpxCreateLabel, SpxCreatePointLight, SpxDeleteSelected, SpxExportPolygonal, SpxImportPolygonal, SpxInvertSelection, SpxLoadScene, SpxMakeAction, S...
[SpxBringToFront, SpxClear, SpxClearLights, SpxClose, SpxCreateLabel, SpxCreatePointLight, SpxDeleteSelected, SpxExportPolygonal, SpxImportPolygonal, SpxInvertSelection, SpxLoadScene, SpxMakeAction, S...
[SpxBringToFront, SpxClear, SpxClearLights, SpxClose, SpxCreateLabel, SpxCreatePointLight, SpxDeleteSelected, SpxExportPolygonal, SpxImportPolygonal, SpxInvertSelection, SpxLoadScene, SpxMakeAction, S...
[SpxBringToFront, SpxClear, SpxClearLights, SpxClose, SpxCreateLabel, SpxCreatePointLight, SpxDeleteSelected, SpxExportPolygonal, SpxImportPolygonal, SpxInvertSelection, SpxLoadScene, SpxMakeAction, S...
[SpxBringToFront, SpxClear, SpxClearLights, SpxClose, SpxCreateLabel, SpxCreatePointLight, SpxDeleteSelected, SpxExportPolygonal, SpxImportPolygonal, SpxInvertSelection, SpxLoadScene, SpxMakeAction, S...
 

nVizx Successfully started 

Swept Surface Examples 

The image below is an example of swept surfaces generated with nVizx 

Image 

 

Plotting the Surfaces 

The SpxShow command below takes the Maple plot command as an argument and plots the specified surface in the nVizx window. 

> rotation := plots[cylinderplot](
func(z),
theta = 0 .. 2*Pi,
z = 0 .. 9, grid = [50, 200] ):
rotation;
SpxShow( rotation );
 

Plot 

 

Here an example of an image created with nVizx 

Image 

 

 

 

Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.
 

Image