Files
EgtExchange/BtlGeomCoStru.h
Dario Sassi 91d1260d8a EgtExchange 3.1e2 :
- in import BTL aggiunta gestione Tenone Coda di Rondine non limitato dal lato dell'arrotondamento (P04=1).
2026-05-13 11:09:23 +02:00

268 lines
14 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2022
//----------------------------------------------------------------------------
// File : BtlGeomCoStru.h Data : 27.02.22 Versione : 2.4b3
// Contenuto : Costanti e strutture per la classe BtlGeom.
//
//
//
// Modifiche : 25.08.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkFrame3d.h"
#include "/EgtDev/Include/EgtStringBase.h"
#include <deque>
//----------------------------------------------------------------------------
// Riconoscimento feature
#define IS_CUT( nG, nP) ( ( nG == 1 || nG == 2) && nP == 10)
#define IS_LONGIT_CUT( nG, nP) ( ( nG == 0 || nG == 3 || nG == 4) && nP == 10)
#define IS_DOUBLE_CUT( nG, nP) ( ( nG == 1 || nG == 2) && nP == 11)
#define IS_RIDGEVALLEY_CUT( nG, nP) ( ( nG == 0) && nP == 12)
#define IS_SAW_CUT( nG, nP) ( ( nG == 0 || nG == 3 || nG == 4) && nP == 13)
#define IS_SLOT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 16)
#define IS_FRONT_SLOT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 17)
#define IS_BIRDS_MOUTH( nG, nP) ( ( nG == 3 || nG == 4) && nP == 20)
#define IS_RAFTER_NOTCH( nG, nP) ( ( nG == 3 || nG == 4) && nP == 25)
#define IS_RIDGE_LAP( nG, nP) ( ( nG == 1 || nG == 2) && nP == 30)
#define IS_LAP_JOINT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 30)
#define IS_NOTCH( nG, nP) ( ( nG == 3 || nG == 4) && nP == 32)
#define IS_LOGHOUSE_HL2( nG, nP) ( ( nG == 3 || nG == 4) && nP == 33)
#define IS_SEATHING_CUT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 34)
#define IS_FRENCH_RIDGELAP( nG, nP) ( ( nG == 1 || nG == 2) && nP == 35)
#define IS_CHAMFER( nG, nP) ( ( nG == 3 || nG == 4) && nP == 36)
#define IS_LOGHOUSE_HL4( nG, nP) ( ( nG == 4) && nP == 37)
#define IS_LOGHOUSE_FRONT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 38)
#define IS_POCKET( nG, nP) ( ( nG == 4) && nP == 39)
#define IS_DRILL( nG, nP) ( ( nG == 3 || nG == 4) && nP == 40)
#define IS_TENON( nG, nP) ( ( nG == 1 || nG == 2) && nP == 50)
#define IS_MORTISE( nG, nP) ( ( nG == 3 || nG == 4) && nP == 50)
#define IS_MORTISE_FRONT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 51)
#define IS_HOUSE( nG, nP) ( ( nG == 1 || nG == 2 || nG == 3 || nG == 4) && nP == 52)
#define IS_HOUSE_MORTISE( nG, nP) ( ( nG == 3 || nG == 4) && nP == 53)
#define IS_DOVETAIL_TENON( nG, nP) ( ( nG == 1 || nG == 2) && nP == 55)
#define IS_DOVETAIL_MORTISE( nG, nP) ( ( nG == 3 || nG == 4) && nP == 55)
#define IS_DTMORTISE_FRONT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 56)
#define IS_MARKING( nG, nP) ( ( nG == 3 || nG == 4) && nP == 60)
#define IS_TEXT( nG, nP) ( ( nG == 4) && nP == 61)
#define IS_SIMPLESCARF( nG, nP) ( ( nG == 1 || nG == 2) && nP == 70)
#define IS_SCARFJOINT( nG, nP) ( ( nG == 1 || nG == 2) && nP == 71)
#define IS_STEPJOINT( nG, nP) ( ( nG == 1 || nG == 2) && nP == 80)
#define IS_STEPJOINTNOTCH( nG, nP) ( ( nG == 3 || nG == 4) && nP == 80)
#define IS_PLANING( nG, nP) ( ( nG == 3 || nG == 4) && nP == 90)
#define IS_PROF_FRONT( nG, nP) ( ( nG == 3 || nG == 4) && nP == 100)
#define IS_PROF_HEADCONCAVE( nG, nP) ( ( nG == 3 || nG == 4) && nP == 101)
#define IS_PROF_HEADCONVEX( nG, nP) ( ( nG == 3 || nG == 4) && nP == 102)
#define IS_PROF_HEADCAMBERED( nG, nP) ( ( nG == 3 || nG == 4) && nP == 103)
#define IS_PROF_HEAD( nG, nP) ( ( nG == 3 || nG == 4) && nP == 106)
#define IS_ROUND_ARCH( nG, nP) ( ( nG == 4) && nP == 104)
#define IS_SPHERE( nG, nP) ( ( nG == 3 || nG == 4) && nP == 107)
#define IS_TRIANGLE_CUT( nG, nP) ( ( nG == 4) && nP == 120)
#define IS_TYROLEAN_DOVETAIL( nG, nP) ( ( nG == 1 || nG == 2 || nG == 3 || nG == 4) && nP == 136)
#define IS_DOVETAIL( nG, nP) ( ( nG == 1 || nG == 2 || nG == 3 || nG == 4) && nP == 138)
#define IS_FREE_CONTOUR( nG, nP) ( ( nG == 0 || nG == 3 || nG == 4) && (nP == 250 || nP == 251 || nP == 252))
#define IS_VARIANT( nG, nP) ( ( nG == 0 || nG == 1 || nG == 2 || nG == 3 || nG == 4) && nP == 900)
//----------------------------------------------------------------------------
// nome gruppo di sistema per informazioni varie
static const std::string INFO_GROUP_NAME = "BtlInfo" ;
// nome gruppo di sistema per riferimenti di definizione assemblaggio
static const std::string ASSEMBLY_GROUP_NAME = "AsseBase" ;
// nome gruppo di sistema per grezzi
static const std::string RAWPARTS_GROUP_NAME = "RawParts" ;
// nome gruppo di sistema per compositi
static const std::string COMPOSITES_GROUP_NAME = "Composites" ;
// nome gruppo temporaneo per direzione di carico
static const std::string LOADINGSIDE_GROUP_NAME = "LoadingSide" ;
// nomi layer standard dei pezzi
static const std::string AUX_LAYER_NAME = "Part" ;
static const std::string BOX_LAYER_NAME = "Box" ;
static const std::string OUTLINE_LAYER_NAME = "Outline" ;
static const std::string PROCESSINGS_LAYER_NAME = "Processings" ;
static const std::string SOLID_LAYER_NAME = "Solid" ;
static const std::string FCSNAME_LAYER_NAME = "FcsName" ;
// nomi entità standard dei pezzi
static const std::string AUX_PART_NAME = "Name" ;
static const std::string BOX_BOX_NAME = "Box" ;
static const std::string BOX_OFFSX_NAME = "Offs" ;
static const std::string OL_OUTSTM_NAME = "Out" ;
static const std::string OL_APERTURESTM_NAME = "Ape" ;
static const std::string OL_TOPREGION_NAME = "Top" ;
static const std::string OL_BOTTOMREGION_NAME = "Bot" ;
static const std::string OL_SUFFIX_REGION_NAME = "Region" ;
static const std::string OL_SHAPE_NAME = "Shape" ;
static const std::string SOLID_SOLID_NAME = "Solid" ;
// chiavi di informazioni associate alle info varie
static const std::string IKEY_BTL_PATH = "BTL" ;
// chiavi di informazioni associate ai pezzi
static const std::string IKEY_PROD_NBR = "PDN" ;
static const std::string IKEY_PDN_ERR = "PDN_ERR" ;
static const std::string IKEY_NAME = "NAM" ;
static const std::string IKEY_COUNT = "CNT" ;
static const std::string IKEY_LENGTH = "L" ;
static const std::string IKEY_WIDTH = "W" ;
static const std::string IKEY_HEIGHT = "H" ;
// chiavi di informazioni associate alle geometrie di outline
static const std::string IKEY_OTL_SIDE = "SIDE" ;
static const std::string IKEY_OTL_REGION = "REGION" ;
// chiavi di informazioni associate alle geometrie di lavorazione
static const std::string IKEY_GROUP = "GRP" ;
static const std::string IKEY_PROC = "PRC" ;
static const std::string IKEY_SIDE = "SIDE" ;
static const std::string IKEY_PAR = "P" ;
static const std::string IKEY_DES = "DES" ;
static const std::string IKEY_PRID = "PRID" ;
static const std::string IKEY_FRAME = "FRAME" ;
static const std::string IKEY_MAINID = "MAINID" ;
static const std::string IKEY_ADJID = "ADJID" ;
static const std::string IKEY_AUXID = "AUXID" ;
static const std::string IKEY_ORIGID = "ORIGID" ;
static const std::string IKEY_START_FACE = "FCS" ;
static const std::string IKEY_END_FACE = "FCE" ;
static const std::string IKEY_SIDEANGS = "SideAngs" ;
static const std::string IKEY_DEPTH = "DEPTH" ;
static const std::string IKEY_POCKET = "PCKT" ;
static const std::string IKEY_RULED = "RULED" ;
static const std::string IKEY_CNT_TYPE = "CNT_TYPE" ;
static const std::string IKEY_CNT_DATA = "CNT_DATA" ;
static const std::string IKEY_CNT_PAR = "CNT_PAR" ;
static const std::string IKEY_TASKID = "TASKID" ;
static const std::string IKEY_DO = "DO" ;
static const std::string IKEY_TRIM = "TRIM" ;
static const std::string IKEY_COL_A = "COL_A" ;
// chiavi di informazioni associate al solido
static const std::string IKEY_VALID = "VALID" ;
// chiavi di informazioni associate al lato di carico
static const std::string IKEY_LSIDE = "LSIDE" ;
// distanza tra pezzi nella disposizione standard lungo Y
const double PART_OFFSET = 300 ;
// costanti di approssimazione per curve
const double CRV_LIN_APPROX = 0.05 ;
const double CRV_LIN_FINE_APPROX = 0.01 ;
const double CRV_ANG_APPROX_DEG = 22.5 ;
// costante di compattazione di superfici
const double STM_COMPACT_APPROX = 0.01 ;
// minima dimensione trasversale di faccia per non essere eliminata
const double FACE_MIN_CROSS_DIM = 1.0 ;
// minimo materiale dietro la faccia dipendente dall'area
const double FACE_MIN_BACK_MAT = 2.0 ;
const double FACE_MIN_BACK_AREA = 400.0 ;
// minimo materiale dietro la faccia, limite assoluto
const double FACE_ZERO_BACK_MAT = 0.5 ;
// minima area di componente staccata
const double FACE_DETACHED_MIN_AREA = 400.0 ;
// minimo spostamento per vari tipi di Mortise
const double MORTISE_DISPL_MIN = 0.5 ;
// raggio fresa di default
const double MILL_DEF_RAD = 12.5 ;
// raggio fresa coda di rondine di default ( misurato in basso dove grande)
const double DTMILL_DEF_RAD = 30.0 ;
// angolo coda di rondine di default
const double DOVETAIL_DEF_ANG = 15.0 ;
// lunghezza extra per tenoni coda di rondine passanti
const double DTTEN_EXTRA_LEN = 5.0 ;
// lunghezza extra per mortase coda di rondine passanti
const double DTMORT_EXTRA_LEN = 10.0 ;
// minima e massima dimensione tasca per mortasa a coda di rondine
const double MIN_DTMORT_POCKET = 70.0 ;
const double MIN_DTMORT_AREA = 100.0 ;
// tolleranza fuoriuscita curve di tasche di code di rondine
const double DTMORT_OUT_CRV_TOL = 30.0 ;
// angolo di fianco per contorno libero default e non definito
const double FC_SIDEANG_DEF = 0.0 ;
const double FC_SIDEANG_NONE = 999.0 ;
// tolleranza fuoriuscita curve di contorni liberi
const double FC_OUT_CRV_TOL = 50.0 ;
// dimensione massima di contorno libero
const double FC_MAX_DIM = 200000.0 ;
// distanza limite tra diagonali per quadrilatero con twist di freecontour
const double FC_TWIST_DIAG_DIST = 2.0 ;
//----------------------------------------------------------------------------
// Numero processo speciale Riferimento ad altro oggetto
const int BTL_OBJECT_REF = 300 ;
//----------------------------------------------------------------------------
// Base del nome file geometria varianti
static const std::string VARIANT_BASENAME = "Variant_" ;
// Pezzo e layer per variante
static const std::string VARIANT_PART = "Process" ;
static const std::string VARIANT_LAYER = "Geom" ;
//----------------------------------------------------------------------------
enum BtlSide { BTL_SIDE_NONE = 0,
BTL_SIDE_FRONT = 1,
BTL_SIDE_BOTTOM = 2,
BTL_SIDE_BACK = 3,
BTL_SIDE_TOP = 4,
BTL_SIDE_LEFT = 5,
BTL_SIDE_RIGHT = 6} ;
static const int SIDE_NBR = 6 ;
//----------------------------------------------------------------------------
enum UserAttrDest { UATD_INFO = 0,
UATD_PART = 1} ;
//----------------------------------------------------------------------------
enum FreeContType { FCT_NONE = 0,
FCT_SAW = 1,
FCT_MILL = 2,
FCT_PEN = 10,
FCT_NAIL = 20,
FCT_GLUE_AREA = 30,
FCT_PLANING_AREA = 40,
FCT_PLASTER_AREA = 50,
FCT_LOCKOUT_AREA = 200} ;
//----------------------------------------------------------------------------
struct FreeContourStart {
int nGroup ;
int nSide ;
double dDepth ;
bool bPocket ;
int nContType ;
int nContData ;
double dContPar ;
std::string sDes ;
Frame3d frRef ;
STRVECTOR vsUAtt ;
int nId ;
int nOtherId ;
FreeContourStart( void)
: nGroup( 0), nSide( 0), dDepth( 0), bPocket( false), nContType( 0), nContData( 0), dContPar( 0), frRef(), nId( -1), nOtherId( -1) {}
FreeContourStart( int nG, int nS, double dD, bool bP, int nCt, int nCd, double dCp, const std::string& sD, const Frame3d& Ref, const STRVECTOR& vsUA, int nI, int nO)
: nGroup( nG), nSide( nS), dDepth( dD), bPocket( bP), nContType( nCt), nContData( nCd), dContPar( dCp), sDes( sD), nId( nI), nOtherId( nO)
{ frRef = Ref ;
for ( const auto& sUA : vsUA)
vsUAtt.emplace_back( sUA) ; }
} ;
typedef std::deque<FreeContourStart> FCSDEQUE ;
//----------------------------------------------------------------------------
struct FreeContourEnt {
int nType ;
Point3d ptP ;
Point3d ptM ;
double dAng ;
int nId ;
int nNextId ;
enum TYPE { START = 0, LINE = 1, ARC = 2, START_CNT0 = 100, START_CNT1 = 101} ;
FreeContourEnt( void)
: nType( START), ptP(), ptM(), dAng( 0), nId( 0), nNextId( 0) {}
FreeContourEnt( int nT, const Point3d& ptPP, const Point3d& ptMM, double dA, int nI, int nO)
: nType( nT), ptP( ptPP), ptM( ptMM), dAng( dA), nId( nI), nNextId( nO) {}
} ;
typedef std::deque<FreeContourEnt> FCEDEQUE ;
//----------------------------------------------------------------------------
enum CrossCut { CROSS_CUT_NONE = 0,
CROSS_CUT_X = 1,
CROSS_CUT_Y = 2,
CROSS_CUT_Z = 4} ;