Constructing a Sheet Body
The function
MbResultType CreateSheetSolid( const MbPlacement3D & placement,
RPArray<MbContour> & contours,
bool unbended,
const MbSheetMetalValues & params,
RPArray<MbSNameMaker> * nameMakers,
RPArray<MbSMBendNames> & resultBends,
MbSolid *& result );
constructs a sheet metal solid by extrusion of planar contours.
The input parameters of the function are:
placement – the local coordinate system;
contours – the contours of the sheet metal solid defined in the XY plane of the local coordinate system;
unbended – a flag for constructing the solid in the unbent state;
params – the construction parameters;
nameMakers – the construction name makers.
The output parameters of the function are the names of the sheet faces of the constructed bends, written into resultBends, and the solid result itself.
If successful, the function returns rt_Success; otherwise, it returns an error code from the MbResultType enumeration (see mb_operation_result.h).
The function is declared in the file action_sheet.h.
If the contours are closed, the sheet metal solid is constructed with the specified thickness along the given contour. Among the closed contours, one contour must be the outer contour containing all the remaining inner contours. Cutouts are formed along the inner contours.
If the contours are open, the sheet metal solid is constructed by extrusion of closed contours over the specified distances. These closed contours are derived from the open contours by rounding the corners between line segments using the radii specified in params or resultBends. The resulting contours are given a sheet metal thickness in one direction or the other. The thickening direction is specified in the operation parameters params. If a contour already contains an arc, the arc must join the neighboring segments smoothly.
Sheet metal solids with bends can only be constructed from open contours, and the unbended flag is meaningful only in this case. If the resultBends array is empty, the bends are constructed using the uniform parameters specified in params, and the names of the sheet faces of the constructed bends are not recorded. If the resultBends array is populated, the number of its elements must match the number of bends being formed.
Bend parameters are looked up as follows. Each contour in the contours array corresponds to a name maker in the nameMakers array, and each name maker contains an array of contour segment names. If a bend is formed at the junction of two line segments, the parameters of that bend are located in the element of the resultBends array whose segName1 and segName2 fields contain the names of those segments. If a bend is formed at the position of an arc, the parameters for it are found in the element of the resultBends array in which segName1 holds the name of the arc and segName2 equals SIMPLENAME_MAX.
Fig. 1 shows a sheet metal solid constructed from several closed sketches:
Fig. 1
Fig. 2 shows a sheet metal solid constructed from an open sketch containing an arc and a pair of line segments joining at an angle:
Fig. 2
The CreateSheetSolid() method adds the MbSheetMetalSolid builder in the newly constructed body log containing all data required to execute the operation. The MbSheetMetalSolid builder is declared in the cr_sheet_metal_solid.h file.