3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Bevel3 Class Reference

Simple bevel for mesh. More...

#include <Bevel3.h>

Public Types

typedef float vertexCoord_t
 Store coords of vertices. More...
 

Public Member Functions

 Bevel3 (comms::cMeshContainer *)
 
void operator() (float radius, const linesCoord_t &dividers)
 Beveling the mesh by 'radius'. More...
 

Detailed Description

Simple bevel for mesh.

Example with debug output:

static const int QK = 5;
// cuboid a
{
static const int size = 50;
static const int quads = 4 * QK;
Matrix4D m = Matrix4D::Identity;
m.SetScaling( Vector3D::One * size / 2.0f );
a.CreateCube( Vector3D( 2.0f ) );
static const float unit = size / ( float )quads;
a.QuadQuantSubd( m, unit, 0.9f );
a.Transform( m );
a.Triangulate();
}
// cuboid b
{
static const int size = 30;
static const int quads = 2 * QK;
Matrix4D m = Matrix4D::Identity;
m.SetScaling( Vector3D::One * size / 2.0f );
m.SetTranslation( Vector3D( 20, 20, 20 ) );
b.CreateCube( Vector3D( 2.0f ) );
static const float unit = size / ( float )quads;
b.QuadQuantSubd( m, unit, 0.9f );
b.Transform( m );
b.Triangulate();
}
DbgLayer( "Sources" );
AddDbgVirginMesh( a, 0x5500AA00 );
AddDbgVirginMesh( b, 0x550000AA );
r.Clear();
r.PerformBooleanOp( a, b, 2, &dividers );
DbgLayer( "After boolean" );
AddDbgVirginMesh( r, 0xFFFFFFFF );
DbgLayer( "Dividers (raw)" );
for ( int i = 0; i < dividers.Count(); ++i ) {
const comms::cVec3& a = dividers[ i ].first;
const comms::cVec3& b = dividers[ i ].second;
AddDbgLine( a, b, 0xFF00FF00, 0xFF0000FF );
AddDbgPoint( a, 0xAAFF0000 );
AddDbgPoint( b, 0xAAFF0000 );
}
Bevel3 bevel( &r );
Bevel3::linesCoord_t ds;
for ( int i = 0; i < dividers.Count(); ++i ) {
const comms::cVec3& a = dividers[ i ].first;
const comms::cVec3& b = dividers[ i ].second;
ds.Add( cLineF3( a, b ) );
}
bevel( 5.0f, ds );
DbgLayer( nullptr );
r.DrawDbg( cMat4::Identity, 0xFF0000FF, 0xFF000055 );
See Also
doTest() in Bevel3.cpp

Member Typedef Documentation

typedef float Bevel3::vertexCoord_t

Store coords of vertices.

Constructor & Destructor Documentation

Bevel3::Bevel3 ( comms::cMeshContainer mesh)
explicit
Warning
Create a default obj mtl when doesn't exists.

Member Function Documentation

void Bevel3::operator() ( float  radius,
const linesCoord_t &  dividers 
)

Beveling the mesh by 'radius'.

Parameters
radiusRadius for cut and bevel.
dividersSet of dividers (any coords in 3D).
See Also
Lines()

The documentation for this class was generated from the following files: