Files
EgtExecutor/LUA_GdbGetSurf.cpp
T
Dario Sassi 7412a3085f EgtExecutor :
- la funzione Exe/Lua SurfBezierParamsFromPoint ora restituisce solo i valori dei parametri U e V che corrispondono al punto
- piccole migliorie.
2026-03-13 13:33:46 +01:00

1371 lines
41 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2020-2020
//----------------------------------------------------------------------------
// File : LUA_GdbGetSurf.cpp Data : 23.03.20 Versione : 2.2c3
// Contenuto : Funzioni di interrogazione delle superfici per LUA.
//
//
//
// Modifiche : 23.03.20 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "LUA.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkCurve.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkLuaAux.h"
using namespace std ;
//----------------------------------------------------------------------------
static int
LuaSurfArea( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero la sua area
double dArea ;
if ( ExeSurfArea( nId, dArea))
LuaSetParam( L, dArea) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfIsClosed( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// verifico se è superficie chiusa
bool bOk = ExeSurfIsClosed( nId) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfVolume( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il suo eventuale volume (se chiusa)
double dVol ;
if ( ExeSurfVolume( nId, dVol))
LuaSetParam( L, dVol) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrNormVersor( lua_State* L)
{
// 1 o 2 parametri : Id [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nRefId = nId ;
LuaGetParam( L, 2, nRefId) ;
LuaClearStack( L) ;
// recupero il versore
Vector3d vtNorm ;
if ( ExeSurfFrNormVersor( nId, nRefId, vtNorm))
LuaSetParam( L, vtNorm) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrGrossArea( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero la sua area senza eventuali buchi
double dArea ;
if ( ExeSurfFrGrossArea( nId, dArea))
LuaSetParam( L, dArea) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrChunkCount( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il numero di componenti connessi (chunk) della regione
int nNbr = ExeSurfFrChunkCount( nId) ;
LuaSetParam( L, nNbr) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrChunkMaxOffset( lua_State* L)
{
// 2 parametri : Id, nChunk
int nId ;
LuaCheckParam( L, 1, nId)
int nChunk ;
LuaCheckParam( L, 2, nChunk)
LuaClearStack( L) ;
// recupero la sua area senza eventuali buchi
double dMaxOffset ;
if ( ExeSurfFrChunkMaxOffset( nId, nChunk, dMaxOffset))
LuaSetParam( L, dMaxOffset) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrChunkSimpleClassify( lua_State* L)
{
// 4 o 5 parametri : Id1, Chunk1, Id2, Chunk2 [, dToler]
int nId1 ;
LuaCheckParam( L, 1, nId1)
int nChunk1 ;
LuaCheckParam( L, 2, nChunk1)
int nId2 ;
LuaCheckParam( L, 3, nId2)
int nChunk2 ;
LuaCheckParam( L, 4, nChunk2)
double dToler = 0 ;
LuaGetParam( L, 5, dToler) ;
LuaClearStack( L) ;
// classifico il chunk della prima regione rispetto a quello della seconda
int nClass = ExeSurfFrChunkSimpleClassify( nId1, nChunk1, nId2, nChunk2, dToler) ;
LuaSetParam( L, nClass) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrTestExternal( lua_State* L)
{
// 2 o 3 parametri : Id1, Id2 [, dMinDist]
int nId1 ;
LuaCheckParam( L, 1, nId1)
int nId2 ;
LuaCheckParam( L, 2, nId2)
double dMinDist = 0 ;
LuaGetParam( L, 3, dMinDist) ;
LuaClearStack( L) ;
// verifico se le due regioni sono esterne con distanza superiore al minimo
bool bOk = ExeSurfFrTestExternal( nId1, nId2, dMinDist) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaExtractSurfFrChunkLoops( lua_State* L)
{
// 3 parametri : nId, nChunk, nDestGrpId
int nId ;
LuaCheckParam( L, 1, nId)
int nChunk ;
LuaCheckParam( L, 2, nChunk)
int nDestGrpId ;
LuaCheckParam( L, 3, nDestGrpId)
LuaClearStack( L) ;
// recupero i contorni del chunk della regione
int nCount = 0 ;
int nNewId = ExeExtractSurfFrChunkLoops( nId, nChunk, nDestGrpId, &nCount) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrMoveSimpleNoCollision( lua_State* L)
{
// 3 o 4 parametri : nId1, nId2, vtMove [, nRefType]
int nId1 ;
LuaCheckParam( L, 1, nId1)
int nId2 ;
LuaCheckParam( L, 2, nId2)
Vector3d vtMove ;
LuaCheckParam( L, 3, vtMove)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// verifico quale è la massima traslazione possibile
double dLen = vtMove.Len() ;
Vector3d vtDir = ( dLen > EPS_SMALL ? vtMove / dLen : V_NULL) ;
bool bOk = ExeSurfFrMoveSimpleNoCollision( nId1, nId2, vtDir, dLen, nRefType) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, dLen) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfFrRotateSimpleNoCollision( lua_State* L)
{
// 4 o 5 parametri : nId1, nId2, ptCen, dAngDeg [, nRefType]
int nId1 ;
LuaCheckParam( L, 1, nId1)
int nId2 ;
LuaCheckParam( L, 2, nId2)
Point3d ptCen ;
LuaCheckParam( L, 3, ptCen)
double dAngDeg ;
LuaCheckParam( L, 4, dAngDeg)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// verifico quale è la massima (in valore assoluto) rotazione possibile
bool bOk = ExeSurfFrRotateSimpleNoCollision( nId1, nId2, ptCen, dAngDeg, nRefType) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, dAngDeg) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmVertexCount( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il numero di vertici della superficie trimesh
int nNbr = ExeSurfTmVertexCount( nId) ;
LuaSetParam( L, nNbr) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetCount( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il numero di facce della superficie trimesh
int nNbr = ExeSurfTmFacetCount( nId) ;
LuaSetParam( L, nNbr) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmPartCount( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il numero di parti della superficie trimesh
int nParts = ExeSurfTmPartCount( nId) ;
if ( nParts >= 0)
LuaSetParam( L, nParts) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetPartAndShellFromFacet( lua_State* L)
{
// 2 parametri : Id SurfTm, Id Facet
int nIdSurfTm ;
LuaCheckParam( L, 1, nIdSurfTm)
int nIdFacet ;
LuaCheckParam( L, 2, nIdFacet)
LuaClearStack( L) ;
// recupero il numero di parti della superficie trimesh
int nPart = - 1 ;
int nShell = - 1 ;
ExeSurfTmGetPartAndShellFromFacet( nIdSurfTm, nIdFacet, nPart, nShell) ;
LuaSetParam( L, nPart) ;
LuaSetParam( L, nShell) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetVertex( lua_State* L)
{
// 2 o 3 parametri : Id, nVert, [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nVert ;
LuaCheckParam( L, 2, nVert)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero il vertice di indice dato (0-based)
Point3d ptVert ;
bool bOk = ExeSurfTmGetVertex( nId, nVert, nRefId, ptVert) ;
if ( bOk)
LuaSetParam( L, ptVert) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetNearestVertex( lua_State* L)
{
// 2 o 3 parametri : Id, ptNear [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptNear ;
LuaCheckParam( L, 2, ptNear)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero il vertice più vicino della superficie
int nVert ;
Point3d ptVert ;
bool bOk = ExeSurfTmGetNearestVertex( nId, ptNear, nRefId, nVert, ptVert) ;
if ( bOk) {
LuaSetParam( L, nVert) ;
LuaSetParam( L, ptVert) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmTriangleNormVersor( lua_State* L)
{
// 2 o 3 parametri : nId, nTria [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nTria ;
LuaCheckParam( L, 2, nTria)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero la normale del triangolo della superficie
Vector3d vtNorm ;
if ( ExeSurfTmTriangleNormVersor( nId, nTria, nRefId, vtNorm))
LuaSetParam( L, vtNorm) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetFromTria( lua_State* L)
{
// 2 parametri : nId, nTria
int nId ;
LuaCheckParam( L, 1, nId)
int nTria ;
LuaCheckParam( L, 2, nTria)
LuaClearStack( L) ;
// recupero l'indice della faccia cui appartiene il triangolo della superficie
int nFacet = ExeSurfTmFacetFromTria( nId, nTria) ;
// restituisco il risultato
if ( nFacet != SVT_NULL)
LuaSetParam( L, nFacet) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetAllVertInFacet( lua_State* L)
{
// 2 parametri : nId, nFacet
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
LuaClearStack( L) ;
// recupero l'elenco dei vertici nella faccia
INTVECTOR vVert ;
bool bOk = ExeSurfTmGetAllVertInFacet( nId, nFacet, vVert) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, vVert) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetFacetBBox( lua_State* L)
{
// 3 parametri : nId, nFacet, nFlag
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nFlag ;
LuaCheckParam( L, 3, nFlag)
LuaClearStack( L) ;
// recupero il bounding box della faccia in locale
BBox3d b3Box ;
bool bOk = ExeSurfTmGetFacetBBox( nId, nFacet, nFlag, b3Box) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, b3Box) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetFacetBBoxGlob( lua_State* L)
{
// 3 parametri : nId, nFacet, nFlag
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nFlag ;
LuaCheckParam( L, 3, nFlag)
LuaClearStack( L) ;
// recupero il bounding box della faccia in globale
BBox3d b3Box ;
bool bOk = ExeSurfTmGetFacetBBoxGlob( nId, nFacet, nFlag, b3Box) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, b3Box) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetFacetBBoxRef( lua_State* L)
{
// 4 parametri : nId, nFacet, nFlag, frRef
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nFlag ;
LuaCheckParam( L, 3, nFlag)
Frame3d frRef ;
LuaCheckParam( L, 4, frRef)
LuaClearStack( L) ;
// recupero il bounding box della faccia nel riferimento indicato
BBox3d b3Box ;
bool bOk = ExeSurfTmGetFacetBBoxRef( nId, nFacet, nFlag, frRef, b3Box) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, b3Box) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetFacetOutlineInfo( lua_State* L)
{
// 2 o 3 parametri : Id, nFacet [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero le informazioni
int nStatus ;
BOOLVECTOR vbOpen ;
INTVECTOR vnAdj ;
PNTVECTOR vptStart ;
VCT3DVECTOR vvtNorm ;
DBLVECTOR vdElev ;
DBLVECTOR vdLen ;
bool bOk = ExeSurfTmGetFacetOutlineInfo( nId, nFacet, nRefId, nStatus, vbOpen, vnAdj, vdLen, vptStart, vvtNorm, vdElev) ;
// restituisco il risultato
if ( bOk) {
LuaSetParam( L, nStatus) ;
LuaSetParam( L, vbOpen) ;
LuaSetParam( L, vnAdj) ;
LuaSetParam( L, vdLen) ;
LuaSetParam( L, vptStart) ;
LuaSetParam( L, vvtNorm) ;
LuaSetParam( L, vdElev) ;
return 7 ;
}
else {
LuaSetParam( L) ;
return 1 ;
}
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetAdjacencies( lua_State* L)
{
// 2 parametri : nId, nFacet
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
LuaClearStack( L) ;
// recupero le adiacenze della faccetta della superficie
INTMATRIX vAdj ;
bool bOk = ExeSurfTmFacetAdjacencies( nId, nFacet, vAdj) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, vAdj) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetNearestEndPoint( lua_State* L)
{
// 3 o 4 parametri : Id, nFacet, ptNear [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
Point3d ptNear ;
LuaCheckParam( L, 3, ptNear)
int nRefId = nId ;
LuaGetParam( L, 4, nRefId) ;
LuaClearStack( L) ;
// recupero il punto End più vicino della faccia della superficie trimesh
Point3d ptEnd ;
Vector3d vtN ;
if ( ExeSurfTmFacetNearestEndPoint( nId, nFacet, ptNear, nRefId, ptEnd, vtN)) {
LuaSetParam( L, ptEnd) ;
LuaSetParam( L, vtN) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetNearestMidPoint( lua_State* L)
{
// 3 o 4 parametri : Id, nFacet, ptNear [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
Point3d ptNear ;
LuaCheckParam( L, 3, ptNear)
int nRefId = nId ;
LuaGetParam( L, 4, nRefId) ;
LuaClearStack( L) ;
// recupero il punto Mid più vicino della faccia della superficie trimesh
Point3d ptMid ;
Vector3d vtN ;
if ( ExeSurfTmFacetNearestMidPoint( nId, nFacet, ptNear, nRefId, ptMid, vtN)) {
LuaSetParam( L, ptMid) ;
LuaSetParam( L, vtN) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetCenter( lua_State* L)
{
// 2 o 3 parametri : Id, nFacet [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero il centro della faccia della superficie trimesh
Point3d ptCen ;
Vector3d vtN ;
if ( ExeSurfTmFacetCenter( nId, nFacet, nRefId, ptCen, vtN)) {
LuaSetParam( L, ptCen) ;
LuaSetParam( L, vtN) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetNormVersor( lua_State* L)
{
// 2 o 3 parametri : Id, nFacet [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero la normale della faccia della superficie trimesh
Vector3d vtNorm ;
if ( ExeSurfTmFacetNormVersor( nId, nFacet, nRefId, vtNorm))
LuaSetParam( L, vtNorm) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetMinAreaRectangle( lua_State* L)
{
// 2 o 3 parametri : Id, nFacet [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nRefId = nId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero il rettangolo di minima area della faccia della superficie trimesh
Frame3d frRect ;
double dDimX, dDimY ;
if ( ExeSurfTmFacetMinAreaRectangle( nId, nFacet, nRefId, frRect, dDimX, dDimY)) {
LuaSetParam( L, frRect) ;
LuaSetParam( L, dDimX) ;
LuaSetParam( L, dDimY) ;
return 3 ;
}
else {
LuaSetParam( L) ;
return 1 ;
}
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetElevationInBBox( lua_State* L)
{
// 3 o 4 o 5 parametri : Id, nFacet, b3Box [, bAcceptOutFacet] [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
BBox3d b3Box ;
LuaCheckParam( L, 3, b3Box)
bool bAcceptOutFacet = false ;
int nRefId = nId ;
if ( ! LuaGetParam( L, 4, nRefId)) {
LuaGetParam( L, 4, bAcceptOutFacet) ;
LuaGetParam( L, 5, nRefId) ;
}
LuaClearStack( L) ;
// calcolo elevazione
double dElev ;
bool bOk = ExeSurfTmFacetElevationInBBox( nId, nFacet, b3Box, bAcceptOutFacet, nRefId, dElev) ;
if ( bOk)
LuaSetParam( L, dElev) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetElevationInClosedSurfTm( lua_State* L)
{
// 3 o 4 parametri : nFacetStmId, nFacet, nClosedStmId [, bAcceptOutFacet]
int nFacetStmId ;
LuaCheckParam( L, 1, nFacetStmId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nClosedStmId ;
LuaCheckParam( L, 3, nClosedStmId)
bool bAcceptOutFacet = false ;
LuaGetParam( L, 4, bAcceptOutFacet) ;
LuaClearStack( L) ;
// calcolo elevazione
double dElev ;
bool bOk = ExeSurfTmFacetElevationInClosedSurfTm( nFacetStmId, nFacet, nClosedStmId, bAcceptOutFacet, dElev) ;
if ( bOk)
LuaSetParam( L, dElev) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetOppositeSide( lua_State* L)
{
// 3 o 4 parametri : Id, nFacet, vtDir [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
Vector3d vtDir ;
LuaCheckParam( L, 3, vtDir)
int nRefId = nId ;
LuaGetParam( L, 4, nRefId) ;
LuaClearStack( L) ;
// recupero i punti estremi della parte di faccia opposta alla direzione
Point3d ptP1, ptPm, ptP2 ;
Vector3d vtIn1, vtOut2 ;
double dLen, dWidth ;
if ( ExeSurfTmFacetOppositeSideEx( nId, nFacet, vtDir, nRefId, ptP1, ptPm, ptP2, vtIn1, vtOut2, dLen, dWidth)) {
LuaSetParam( L, ptP1) ;
LuaSetParam( L, ptPm) ;
LuaSetParam( L, ptP2) ;
LuaSetParam( L, vtIn1) ;
LuaSetParam( L, vtOut2) ;
LuaSetParam( L, dLen) ;
LuaSetParam( L, dWidth) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 7 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmFacetsContact( lua_State* L)
{
// 3 o 4 parametri : Id, nF1, nF2 [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nF1 ;
LuaCheckParam( L, 2, nF1)
int nF2 ;
LuaCheckParam( L, 3, nF2)
int nRefId = nId ;
LuaGetParam( L, 4, nRefId) ;
LuaClearStack( L) ;
// recupero i dati di contatto tra le due facce
bool bAdjac ;
Point3d ptP1, ptP2 ;
double dAng = 0 ;
if ( ExeSurfTmFacetsContact( nId, nF1, nF2, nRefId, bAdjac, ptP1, ptP2, dAng)) {
LuaSetParam( L, bAdjac) ;
LuaSetParam( L, ptP1) ;
LuaSetParam( L, ptP2) ;
LuaSetParam( L, dAng) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 4 ;
}
//----------------------------------------------------------------------------
static int
LuaExtractSurfTmLoops( lua_State* L)
{
// 2 parametri : nId, nDestGrpId
int nId ;
LuaCheckParam( L, 1, nId)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
LuaClearStack( L) ;
// recupero i contorni della superficie
int nCount = 0 ;
int nNewId = ExeExtractSurfTmLoops( nId, nDestGrpId, &nCount) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaGetSurfTmSilhouette( lua_State* L)
{
// 4 o 5 o 6 parametri : nId, vtDir, dToler, nDestGrpId [, nRefType [, bAllTria]]
int nId ;
LuaCheckParam( L, 1, nId)
Vector3d vtDir ;
LuaCheckParam( L, 2, vtDir)
double dToler ;
LuaCheckParam( L, 3, dToler)
int nDestGrpId ;
LuaCheckParam( L, 4, nDestGrpId)
int nRefType = RTY_DEFAULT ;
bool bAllTria = false ;
if ( LuaGetParam( L, 5, nRefType))
LuaGetParam( L, 6, bAllTria) ;
else
LuaGetParam( L, 5, bAllTria) ;
LuaClearStack( L) ;
// recupero i contorni della superficie
int nCount = 0 ;
int nNewId = ExeGetSurfTmSilhouette( nId, vtDir, dToler, nDestGrpId, nRefType, &nCount, bAllTria) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaGetSurfTmParSilhouettes( lua_State* L)
{
// 6 o 7 parametri : vIds, ptOn, vtN, vdDist, dToler, nDestGrpId [, nRefType]
INTVECTOR vIds ;
LuaCheckParam( L, 1, vIds)
Point3d ptOn ;
LuaCheckParam( L, 2, ptOn)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
DBLVECTOR vdDist ;
LuaCheckParam( L, 4, vdDist)
double dToler ;
LuaCheckParam( L, 5, dToler)
int nDestGrpId ;
LuaCheckParam( L, 6, nDestGrpId)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// recupero i contorni della superficie
int nCount = 0 ;
int nNewId = ExeGetSurfTmParSilhouettes( vIds, ptOn, vtN, vdDist, dToler, nDestGrpId, nRefType, &nCount) ;
// restituisco il risultato
if ( nCount >= 0)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaExtractSurfTmFacetLoops( lua_State* L)
{
// 3 parametri : nId, nFacet, nDestGrpId
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nDestGrpId ;
LuaCheckParam( L, 3, nDestGrpId)
LuaClearStack( L) ;
// recupero i contorni della faccetta della superficie
int nCount = 0 ;
int nNewId = ExeExtractSurfTmFacetLoops( nId, nFacet, nDestGrpId, &nCount) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaExtractSurfTmTriaLoop( lua_State* L)
{
// 3 parametri : nId, nT, nDestGrpId
int nId ;
LuaCheckParam( L, 1, nId)
int nT ;
LuaCheckParam( L, 2, nT)
int nDestGrpId ;
LuaCheckParam( L, 3, nDestGrpId)
LuaClearStack( L) ;
// recupero i contorni della superficie
int nNewId = ExeExtractSurfTmTriaLoop( nId, nT, nDestGrpId) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaCopySurfTmFacet( lua_State* L)
{
// 3 parametri : nId, nFacet, nDestGrpId
int nId ;
LuaCheckParam( L, 1, nId)
int nFacet ;
LuaCheckParam( L, 2, nFacet)
int nDestGrpId ;
LuaCheckParam( L, 3, nDestGrpId)
LuaClearStack( L) ;
// copio la faccia della superficie nel gruppo indicato
int nNewId = ExeCopySurfTmFacet( nId, nFacet, nDestGrpId) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetEdges( lua_State* L)
{
// 2 o 3 parametri : nId, nDestGrpId [, bSmoothAng]
int nId ;
LuaCheckParam( L, 1, nId)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
bool bSmoothAng = true ;
LuaGetParam( L, 3, bSmoothAng) ;
LuaClearStack( L) ;
// calcolo gli spigoli della superficie
int nCount ;
int nFirstId = ExeSurfTmGetEdges( nId, nDestGrpId, bSmoothAng, &nCount) ;
// restituisco il risultato
if ( nFirstId != GDB_ID_NULL || nCount != -1) {
LuaSetParam( L, nFirstId) ;
LuaSetParam( L, nCount) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfTmGetCurvature( lua_State* L)
{
// 2 parametri : nStmId, nIndV
int nStmId ;
LuaCheckParam( L, 1, nStmId) ;
int nIndVertex ;
LuaCheckParam( L, 2, nIndVertex) ;
LuaClearStack( L) ;
double dK1 = 0., dK2 = 0. ;
Vector3d vtK1 = V_NULL, vtK2 = V_NULL ;
bool bOk = ExeSurfTmGetCurvatures( nStmId, nIndVertex, dK1, vtK1, dK2, vtK2) ;
LuaSetParam( L, bOk) ;
if ( bOk) {
LuaSetParam( L, dK1) ;
LuaSetParam( L, vtK1) ;
LuaSetParam( L, dK2) ;
LuaSetParam( L, vtK2) ;
return 5 ;
}
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetPoint( lua_State* L)
{
// 3 o 4 parametri : nSurfId, dU, dV [, nRefId]
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
double dU ;
LuaCheckParam( L, 2, dU)
double dV ;
LuaCheckParam( L, 3, dV)
int nRefId = nSurfId ;
LuaGetParam( L, 4, nRefId) ;
LuaClearStack( L) ;
// recupero i dati del punto
Point3d ptP ;
bool bOk = ExeSurfBezierGetPoint( nSurfId, dU, dV, nRefId, ptP) ;
if ( bOk)
LuaSetParam( L, ptP) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetPointD1( lua_State* L)
{
// 5 o 6 parametri : nSurfId, dU, dV, nUsd, nVsd [, nRefId]
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
double dU ;
LuaCheckParam( L, 2, dU)
double dV ;
LuaCheckParam( L, 3, dV)
int nUsd ;
LuaCheckParam( L, 4, nUsd)
int nVsd ;
LuaCheckParam( L, 5, nVsd)
int nRefId = nSurfId ;
LuaGetParam( L, 6, nRefId) ;
LuaClearStack( L) ;
// recupero i dati del punto
Point3d ptP ;
Vector3d vtDerU, vtDerV ;
bool bOk = ExeSurfBezierGetPointD1( nSurfId, dU, dV, nUsd, nVsd, nRefId, ptP, vtDerU, vtDerV) ;
if ( bOk) {
LuaSetParam( L, ptP) ;
LuaSetParam( L, vtDerU) ;
LuaSetParam( L, vtDerV) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 3 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetPointNrmD1( lua_State* L)
{
// 5 o 6 parametri : nSurfId, dU, dV, nUsd, nVsd [, nRefId]
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
double dU ;
LuaCheckParam( L, 2, dU)
double dV ;
LuaCheckParam( L, 3, dV)
int nUsd ;
LuaCheckParam( L, 4, nUsd)
int nVsd ;
LuaCheckParam( L, 5, nVsd)
int nRefId = nSurfId ;
LuaGetParam( L, 6, nRefId) ;
LuaClearStack( L) ;
// recupero i dati del punto
Point3d ptP ;
Vector3d vtN ;
Vector3d vtDerU, vtDerV ;
bool bOk = ExeSurfBezierGetPointNrmD1( nSurfId, dU, dV, nUsd, nVsd, nRefId, ptP, vtN, vtDerU, vtDerV) ;
if ( bOk) {
LuaSetParam( L, ptP) ;
LuaSetParam( L, vtN) ;
LuaSetParam( L, vtDerU) ;
LuaSetParam( L, vtDerV) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 4 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetCurveU( lua_State* L)
{
// 3 parametri : nSurfId, dV, nDestGrp
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
double dV ;
LuaCheckParam( L, 2, dV)
int nDestGrp ;
LuaCheckParam( L, 3, nDestGrp)
LuaClearStack( L) ;
// recupero la curva
int nNewId = ExeSurfBezierGetCurveU( nSurfId, dV, nDestGrp) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetCurveV( lua_State* L)
{
// 3 parametri : nSurfId, dU, nDestGrp
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
double dU ;
LuaCheckParam( L, 2,dU)
int nDestGrp ;
LuaCheckParam( L, 3, nDestGrp)
LuaClearStack( L) ;
// recupero la curva
int nNewId = ExeSurfBezierGetCurveV( nSurfId, dU, nDestGrp) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezParamsFromPoint( lua_State* L)
{
// 2 o 3 parametri : nSurfId, ptOnSurf [, nRefId]
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
Point3d ptOnSurf ;
LuaCheckParam( L, 2, ptOnSurf)
int nRefId = nSurfId ;
LuaGetParam( L, 3, nRefId) ;
LuaClearStack( L) ;
// recupero le coordinate parametriche del punto
double dU = - 1 ;
double dV = - 1 ;
bool bOk = ExeSurfBezierParamsFromPoint( nSurfId, ptOnSurf, nRefId, dU, dV) ;
if ( bOk) {
LuaSetParam( L, dU) ;
LuaSetParam( L, dV) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetInfo( lua_State* L)
{
// 1 parametro : nSurfId
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
LuaClearStack( L) ;
// recupero la curva
int nDegU, nDegV ;
int nSpanU, nSpanV ;
bool bIsRat, bTrimmed ;
bool bOk = ExeSurfBezierGetInfo( nSurfId, nDegU, nDegV, nSpanU, nSpanV, bIsRat, bTrimmed) ;
if ( bOk) {
LuaSetParam( L, nDegU) ;
LuaSetParam( L, nDegV) ;
LuaSetParam( L, nSpanU) ;
LuaSetParam( L, nSpanV) ;
LuaSetParam( L, bIsRat) ;
LuaSetParam( L, bTrimmed) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 6 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetControlCurveU( lua_State* L)
{
// 3 parametri : nSurfId, nIndV, nDestGrp
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
int nIndV ;
LuaCheckParam( L, 2, nIndV)
int nDestGrp ;
LuaCheckParam( L, 3, nDestGrp)
LuaClearStack( L) ;
// recupero la curva
int nNewId = ExeSurfBezierGetControlCurveU( nSurfId, nIndV, nDestGrp) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaSurfBezierGetControlCurveV( lua_State* L)
{
// 3 parametri : nSurfId, nIndU, nDestGrp
int nSurfId ;
LuaCheckParam( L, 1, nSurfId)
int nIndU ;
LuaCheckParam( L, 2, nIndU)
int nDestGrp ;
LuaCheckParam( L, 3, nDestGrp)
LuaClearStack( L) ;
// recupero la curva
int nNewId = ExeSurfBezierGetControlCurveV( nSurfId, nIndU, nDestGrp) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaExtractSurfBezierLoops( lua_State* L)
{
// 2 parametri : nId, nDestGrpId
int nId ;
LuaCheckParam( L, 1, nId)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
LuaClearStack( L) ;
// recupero i contorni della superficie
int nCount = 0 ;
int nNewId = ExeExtractSurfBezierLoops( nId, nDestGrpId, &nCount) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaShowSurfBezierControlPoints( lua_State* L)
{
// 2 parametri : nCrvId, nDestGrpId
int nCrvId ;
LuaCheckParam( L, 1, nCrvId)
int nDestGrpId ;
LuaCheckParam( L, 2, nDestGrpId)
LuaClearStack( L) ;
int nCount = 0 ;
int nId = ExeShowSurfBezierControlPoints( nCrvId, nDestGrpId, &nCount) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL) {
LuaSetParam( L, nId) ;
LuaSetParam( L, nCount) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbGetSurf( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfArea", LuaSurfArea) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfIsClosed", LuaSurfIsClosed) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfVolume", LuaSurfVolume) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrNormVersor", LuaSurfFrNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrGrossArea", LuaSurfFrGrossArea) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrChunkCount", LuaSurfFrChunkCount) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrChunkMaxOffset", LuaSurfFrChunkMaxOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrChunkSimpleClassify", LuaSurfFrChunkSimpleClassify) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrTestExternal", LuaSurfFrTestExternal) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfFrChunkLoops", LuaExtractSurfFrChunkLoops) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrMoveSimpleNoCollision", LuaSurfFrMoveSimpleNoCollision) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrRotateSimpleNoCollision", LuaSurfFrRotateSimpleNoCollision) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmVertexCount", LuaSurfTmVertexCount) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetCount", LuaSurfTmFacetCount) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmPartCount", LuaSurfTmPartCount) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetPartAndShellFromFacet", LuaSurfTmGetPartAndShellFromFacet) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetVertex", LuaSurfTmGetVertex) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetNearestVertex", LuaSurfTmGetNearestVertex) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmTriangleNormVersor", LuaSurfTmTriangleNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetFromTria", LuaSurfTmFacetFromTria) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetAllVertInFacet", LuaSurfTmGetAllVertInFacet) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBox", LuaSurfTmGetFacetBBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxGlob", LuaSurfTmGetFacetBBoxGlob) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxRef", LuaSurfTmGetFacetBBoxRef) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetOutlineInfo", LuaSurfTmGetFacetOutlineInfo) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetAdjacencies", LuaSurfTmFacetAdjacencies) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetNearestEndPoint", LuaSurfTmFacetNearestEndPoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetNearestMidPoint", LuaSurfTmFacetNearestMidPoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetCenter", LuaSurfTmFacetCenter) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetNormVersor", LuaSurfTmFacetNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetMinAreaRectangle", LuaSurfTmFacetMinAreaRectangle) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetElevationInBBox", LuaSurfTmFacetElevationInBBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetElevationInClosedSurfTm", LuaSurfTmFacetElevationInClosedSurfTm) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetOppositeSide", LuaSurfTmFacetOppositeSide) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetsContact", LuaSurfTmFacetsContact) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfTmLoops", LuaExtractSurfTmLoops) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfTmSilhouette", LuaGetSurfTmSilhouette) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfTmParSilhouettes", LuaGetSurfTmParSilhouettes) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfTmFacetLoops", LuaExtractSurfTmFacetLoops) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfTmTriaLoop", LuaExtractSurfTmTriaLoop) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCopySurfTmFacet", LuaCopySurfTmFacet) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetEdges", LuaSurfTmGetEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetCurvature", LuaSurfTmGetCurvature) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetPoint", LuaSurfBezierGetPoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetPointD1", LuaSurfBezierGetPointD1) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetPointNrmD1", LuaSurfBezierGetPointNrmD1) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetCurveU", LuaSurfBezierGetCurveU) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetCurveV", LuaSurfBezierGetCurveV) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezParamsFromPoint", LuaSurfBezParamsFromPoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetInfo", LuaSurfBezierGetInfo) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetControlCurveU", LuaSurfBezierGetControlCurveU) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierGetControlCurveV", LuaSurfBezierGetControlCurveV) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfBezierLoops", LuaExtractSurfBezierLoops) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtShowSurfBezierControlPoints", LuaShowSurfBezierControlPoints) ;
return bOk ;
}