18 Commits

Author SHA1 Message Date
Daniele Bariletti fd2a262cb2 - aggiunta parametro per la creazione di splitbottom che converge su un foro circolare. 2025-03-13 11:53:24 +01:00
Daniele Bariletti 60a031c91d - aggiunti nuovi parametri per la creazione di diversi tipi di fondo splittato.
- correzioni varie.
2025-03-07 16:20:43 +01:00
Daniele Bariletti e9fbae9561 - aggiornato elenco parametri per permettere la creazione di due tipi diversi di fori nei fondi di lavandino
- aggiunta la possibilità di scrivere più info in un pezzo in creazione.
2025-03-06 14:56:26 +01:00
Daniele Bariletti ebe2f0dd22 - aggiunta funzione per pulire l'outloop di un part creato come edge. 2025-02-27 14:30:00 +01:00
Daniele Bariletti 89b6b80260 - aggiunta controlli per la gestione degli edge di un part. 2025-02-27 12:18:31 +01:00
Daniele Bariletti f8af3d612c - corretta la funzione per la creazione di un fondo di lavandino come pezzo unico. 2025-02-26 11:54:15 +01:00
Nicola Pievani ea1e4778bf Merge branch 'Cabinet_Top_Chicken' of https://gitlab.steamware.net/egalware-cadcam/lua/StoneSolidGen into Cabinet_Top_Chicken 2025-02-24 10:11:43 +01:00
Nicola Pievani fc30fd5fa1 Gestione figure parametriche 2025-02-24 09:27:03 +01:00
Daniele Bariletti 62041468d8 Merge branch 'Cabinet_Top_Chicken' of https://gitlab.steamware.net/egalware-cadcam/lua/stonesolidgen into Cabinet_Top_Chicken 2025-02-21 12:17:08 +01:00
Daniele Bariletti 205253d1cc - gestite le info da scrivere su un part creato da template. 2025-02-21 12:17:04 +01:00
Nicola Pievani d6bf10959d Merge branch 'Cabinet_Top_Chicken' of https://gitlab.steamware.net/egalware-cadcam/lua/StoneSolidGen into Cabinet_Top_Chicken 2025-02-20 17:12:10 +01:00
Nicola Pievani 0f437d89e7 Prima versione (Bozza) gestione parametrico 2d 2025-02-20 17:11:19 +01:00
Daniele Bariletti 6a0a872b0b - ultimata la gestione delle giunzioni tra paretine. 2025-02-20 16:47:43 +01:00
Daniele Bariletti 45aedbbbc7 - corretta gestione degli offset per le paretine. 2025-02-19 15:46:23 +01:00
Daniele Bariletti 64b9a002be - piccola correzione. 2025-02-17 17:39:33 +01:00
Daniele Bariletti 2a1f155e98 - piccola correzione. 2025-02-17 17:38:43 +01:00
Daniele Bariletti 883c5a2dbd - corretta la gestione della creazione delle paretine in base al tipo di giunzione. 2025-02-17 17:38:24 +01:00
Daniele Bariletti e6ed9a2ec6 - aggiunta gestione della modifica delle paretine
- aggiunta la funzione per il clear della tabella globale
- resa pubblica la funzione per riempire la tabella dalle info di un part
- aggiunta la possibilità di scrivere un'info addizionale nelle paretine.
2025-02-14 16:56:52 +01:00
3 changed files with 841 additions and 176 deletions
+3
View File
@@ -314,6 +314,9 @@ local function CreateSolid()
IdEnt_Part = nIdTrimTot
SLD.CurrPartSolid = IdP_SOLID
SLD.CurrSrfTmId = nIdTrimTot
--scrivo l'info dello spessore nel part
EgtSetInfo(IdFP, "Th", EgtNumToString(SLD.THICK))
end
--
+235
View File
@@ -0,0 +1,235 @@
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
-- recupro il primo oggeto (da modificare)
local nId = EgtGetFirstSelectedObj()
-- recupero il secondo oggetto (rispetto al quale riferirsi)
local nId2 = EgtGetNextSelectedObj()
local PAR = {}
_G.PAR = PAR
PAR.nId1 = -1
PAR.Pt1 = Point3d(0,0,0)
PAR.dU1 = 0.0
PAR.nId2 = -1
PAR.Pt2 = Point3d(0,0,0)
PAR.dU2 = 0.0
PAR.nSubCrv1 = 0
PAR.nSubCrv2 = 0
PAR.Len = 0.0
PAR.vtMove = Vector3d(0,0,0)
local function ErasePoint( Id)
local IdPt1 = EgtGetInfo(Id, 'DrawPoint', 'i')
EgtErase( IdPt1)
end
--
local function DrawPoint( Id, Pt, sCol)
if Id > -1 then
ErasePoint( Id)
local Lay = EgtGetParent( Id)
local IdPt1 = EgtPoint( Lay, Pt, GDB_RT.GLOB)
EgtSetColor( {IdPt1}, EgtStdColor( sCol))
EgtSetInfo( Id, 'DrawPoint', IdPt1)
EgtSelectObj( IdPt1)
EgtDraw()
end
end
--
function PAR.DrawFirstPoint()
if PAR.nId1 > -1 then
DrawPoint( PAR.nId1, PAR.Pt1, 'RED')
end
end
--
function PAR.DrawSecondPoint()
if PAR.nId2 > -1 then
DrawPoint( PAR.nId2, PAR.Pt2, 'BLUE')
end
end
--
-- Accosto due linee
function PAR.LinksLine()
local vtMove = Point3d(PAR.Pt2) - Point3d(PAR.Pt1)
PAR.vtMove = vtMove
EgtMove( {PAR.nId1}, vtMove, GDB_RT.GLOB)
ErasePoint( PAR.nId1)
ErasePoint( PAR.nId2)
EgtDraw()
end
--
-- Ottenco una curva compisita (non posso tornare indietro)
function PAR.JointLine()
EgtCurveCompoByChain( EgtGetParent(PAR.nId1), {PAR.nId1,PAR.nId2}, Point3d(PAR.Pt2), true, GDB_RT.GLOB)
PAR.Reset()
EgtDraw()
end
--
-- Riposiziono il primo segmento nel punto di partenza
function PAR.UndoLinksLine()
if PAR.nId1 > -1 then
EgtMove( {PAR.nId1}, PAR.vtMove*(-1), GDB_RT.GLOB)
end
end
--
local function EraseLinearDimension()
local IdDimension = EgtGetInfo( PAR.nId1, 'LinearDim'..tostring(PAR.nSubCrv1), 'i')
EgtErase( IdDimension)
end
--
function PAR.DrawLinearDimension()
EraseLinearDimension()
local vtDir = EgtSV( PAR.nId1, GDB_RT.GLOB)
vtDir:rotate({0,0,1}, 90)
local ptStart = EgtUP( PAR.nId1, PAR.nSubCrv1, GDB_RT.GLOB)
local ptEnd = EgtUP( PAR.nId1, (PAR.dU1 == PAR.nSubCrv1 and PAR.nSubCrv1 + 1 or PAR.dU1), GDB_RT.GLOB)
local IdDimension = EgtAlignedDimension( EgtGetParent(PAR.nId1), ptStart, ptEnd,vtDir * 50,'<>',GDB_RT.GLOB)
EgtSetInfo( PAR.nId1, 'LinearDim'..tostring(PAR.nSubCrv1), IdDimension)
ErasePoint( PAR.nId1)
EgtDraw()
end
--
function PAR.LinearDimension()
if PAR.nId1 == -1 then return end
local dFinalLen = tonumber( PAR.Len )
if PAR.dU1 == PAR.nSubCrv1 then
local vtDir = EgtUV( PAR.nId1, PAR.nSubCrv1+0.1, GDB_RT.GLOB)
local dStartLen = dist(EgtUP( PAR.nId1, PAR.dU1, GDB_RT.GLOB), EgtUP( PAR.nId1, PAR.dU1 + 1, GDB_RT.GLOB))
vtDir = vtDir * ( dFinalLen - dStartLen) * (-1)
local NewStartPoint = EgtUP( PAR.nId1, PAR.dU1, GDB_RT.GLOB) + vtDir
if not (EgtGetType(PAR.nId1) == GDB_TY.CRV_COMPO) then
EgtModifyCurveStartPoint( PAR.nId1, NewStartPoint, GDB_RT.GLOB)
else
EgtModifyCurveCompoJoint( PAR.nId1, PAR.dU1, NewStartPoint, GDB_RT.GLOB)
end
else
local vtDir = EgtUV( PAR.nId1, PAR.nSubCrv1+0.1, GDB_RT.GLOB)
local dStartLen = dist(EgtUP( PAR.nId1, PAR.dU1, GDB_RT.GLOB), EgtUP( PAR.nId1, PAR.nSubCrv1, GDB_RT.GLOB))
vtDir = vtDir * ( dFinalLen - dStartLen)
local NewEndPoint = EgtUP( PAR.nId1, PAR.dU1, GDB_RT.GLOB) + vtDir
if not (EgtGetType(PAR.nId1) == GDB_TY.CRV_COMPO) then
EgtModifyCurveEndPoint( PAR.nId1, NewEndPoint, GDB_RT.GLOB)
else
EgtModifyCurveCompoJoint( PAR.nId1, PAR.dU1, NewEndPoint, GDB_RT.GLOB)
end
end
end
--
local function EraseAngularDimension()
local IdDimension = EgtGetInfo( PAR.nId1, 'AngularDim', 'i')
EgtErase( IdDimension)
end
--
function PAR.DrawAngularDimension()
EraseAngularDimension()
local vtDir = EgtSV( PAR.nId1, GDB_RT.GLOB)
local vtDir1 = Vector3d(1,0,0)
if nId2 then
vtDir1 = EgtSV( PAR.nId2, GDB_RT.GLOB)
end
IdDimension = EgtAngularDimension( EgtGetParent(PAR.nId1),EgtSP(PAR.nId1, GDB_RT.GLOB),EgtSP(PAR.nId1, GDB_RT.GLOB) + vtDir1,EgtSP(PAR.nId1, GDB_RT.GLOB) + vtDir, vtDir*50,'<>',GDB_RT.GLOB)
EgtSetInfo( nId, 'AngularDim', IdDimension)
EgtDraw()
end
--
function PAR.AngularDimension()
local vtDir = EgtUV( PAR.nId1, PAR.nSubCrv1+0.1, GDB_RT.GLOB)
if PAR.nId2 then
vtDir1 = EgtSV( PAR.nId2, GDB_RT.GLOB)
end
local dStartAng = GetRotation(vtDir, vtDir1, Z_AX())
local vsAng = PAR.Ang
local dFinalAng = tonumber( vsAng)
local ptAx = EgtUP(PAR.nId1, PAR.dU1, GDB_RT.GLOB)
EgtRotate({PAR.nId1},ptAx,Z_AX(), math.abs(dFinalAng-dStartAng),GDB_RT.GLOB)
end
function PAR.Reset()
ErasePoint( PAR.nId1)
PAR.nId1 = -1
PAR.Pt1 = Point3d(0,0,0)
PAR.dU1 = 0.0
ErasePoint( PAR.nId2)
PAR.nId2 = -1
PAR.Pt2 = Point3d(0,0,0)
PAR.dU2 = 0.0
PAR.nSubCrv1 = 0
PAR.nSubCrv2 = 0
end
--
local function SelectConstraint(sMsgComboBox)
local vsVal = EgtDialogBox( 'Select constraint',
{ 'Show', sMsgComboBox})
if not vsVal then return end
local Constraint = string.gsub( vsVal[1], '%s+', '')
if Constraint == 'Startpoint' then
TabConstraint.Stp = 'FIXED'
if nId2 then
local vsSelPt = EgtDialogBox( 'Type of joint?',
{ 'Show', 'CB:* Start-End, Start-Start, End-Start, End-End'})
local FinalPonint = EgtEP( nId2, GDB_RT.GLOB)
local StartPoint = EgtSP( nId, GDB_RT.GLOB)
if vsSelPt then
if vsSelPt[1] == 'Start-Start' then
FinalPonint = EgtSP( nId2, GDB_RT.GLOB)
elseif vsSelPt[1] == 'End-Start' then
FinalPonint = EgtSP( nId2, GDB_RT.GLOB)
StartPoint = EgtEP( nId, GDB_RT.GLOB)
elseif vsSelPt[1] == 'End-End' then
StartPoint = EgtEP( nId, GDB_RT.GLOB)
end
end
EgtSetInfo(nId2, StP, 'LINKED')
local vtMove = FinalPonint - StartPoint
EgtMove(GetLinkedLine(), vtMove, GDB_RT.GLOB)
-- EgtAddCurveCompoCurve
TabConstraint.Stp = 'LINKED'
end
elseif Constraint == 'Lenght' then
TabConstraint.Len = 'FIXED'
local dStartLen = EgtCurveLength( nId)
local vsLen = EgtDialogBox( 'Define constraint value',
{ 'Lenght', tostring(dStartLen)})
if vsLen then
local vtDir = EgtSV( nId, GDB_RT.GLOB)
local dFinalLen = tonumber( vsLen[1])
vtDir = vtDir * ( dFinalLen - dStartLen)
local NewEndPoint = EgtEP( nId, GDB_RT.GLOB) + vtDir
EgtModifyCurveEndPoint( nId, NewEndPoint, GDB_RT.GLOB)
end
elseif Constraint == 'Direction' then
TabConstraint.Dir = 'FIXED'
local vtDir = EgtSV( nId, GDB_RT.GLOB)
local vtDir1 = Vector3d(1,0,0)
if nId2 then
vtDir1 = EgtSV( nId2, GDB_RT.GLOB) * (-1)
end
local dStartAng = math.acos( vtDir*vtDir1) * 180 / math.pi
local vsAng = EgtDialogBox( 'Define constraint value',
{ 'Angle', tostring(dStartAng)})
if vsAng then
local dFinalAng = tonumber( vsAng[1])
EgtRotate({nId},EgtSP(nId, GDB_RT.GLOB),{0,0,1}, math.abs(dFinalAng-dStartAng),GDB_RT.GLOB)
vtDir = EgtSV( nId, GDB_RT.GLOB)
end
end
end
--
+603 -176
View File
File diff suppressed because it is too large Load Diff