markuno_lib 1.1.54 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markuno_lib",
3
- "version": "1.1.54",
3
+ "version": "1.2.2",
4
4
  "description": "Croswil Markuno Language Lib",
5
5
  "authors": [
6
6
  "Croswil <info@croswil.com>"
@@ -28,11 +28,6 @@
28
28
  "require": "./bin/markcad.js",
29
29
  "types": "./types/markcad.d.ts"
30
30
  },
31
- "./cad3d": {
32
- "import": "./bin/markcad3d.js",
33
- "require": "./bin/markcad3d.js",
34
- "types": "./types/markcad3d.d.ts"
35
- },
36
31
  "./marked": {
37
32
  "import": "./bin/marked.js",
38
33
  "require": "./bin/marked.js",
@@ -174,6 +174,7 @@ export class Punto2 {
174
174
  * @returns {Punto2} Nuovo punto con le coordinate normalizzate
175
175
  */ dir(): Punto2;
176
176
  }
177
+ export const SIDE: any;
177
178
  export var SP: Readonly<{
178
179
  __proto__: any;
179
180
  addhoriz: (ff: any, tipodim: any, dim: any, cod: any, align: any, cuts: any) => any;
@@ -267,6 +268,7 @@ export class Vis2d {
267
268
  addarea(s: any, color?: any): this;
268
269
  addoffset(x: any, y: any): this;
269
270
  }
271
+ export function addmovpivot(gcad: any, grp: any, movimento: any, op?: {}, x?: number, y?: number, z?: number): any;
270
272
  /**
271
273
  * Calcola l'angolo tra due vettori in gradi.
272
274
  * @param {Object} v1 - Primo vettore {x,y}
@@ -290,10 +292,20 @@ export namespace blocked {
290
292
  let fetch: any;
291
293
  let XMLHttpRequest: any;
292
294
  }
293
- /**
294
- * Classe per la gestione degli errori con funzionalità di accumulo e formattazione
295
- */ export function clamp(n: any, min?: number, max?: number): any;
295
+ export function calcolatasks(scena: any): {
296
+ tipo: any;
297
+ ori: any;
298
+ lavs: any[];
299
+ x: any;
300
+ y: any;
301
+ z: any;
302
+ id: any;
303
+ }[];
304
+ export function clamp(n: any, min?: number, max?: number): any;
296
305
  export function clean(k: any, locase?: boolean): any;
306
+ export function creategroup(name: any): any;
307
+ export function deletegroup(grpbase: any, name: any): void;
308
+ export function edgesfromgeometry(g1: any, layer?: number): any;
297
309
  export function elaborapercorso(sh1: any, bordo: any, taglio: any, oggetti: any, countid?: number): {
298
310
  countid: number;
299
311
  shape2: any;
@@ -302,7 +314,28 @@ export function elaborapercorso(sh1: any, bordo: any, taglio: any, oggetti: any,
302
314
  dati: any[];
303
315
  draws: any[];
304
316
  };
317
+ /**
318
+ * Crea una geometria estrusa con opzioni avanzate
319
+ * @param {string} orient - Orientamento dell'estrusione
320
+ * @param {number} hshape - Altezza dell'estrusione
321
+ * @param {Object} shape - Forma base
322
+ * @param {Array} holes - Array di fori
323
+ * @param {Array} mats - Array di materiali
324
+ * @param {Object} options - Opzioni di configurazione
325
+ * @returns {THREE.Group} Gruppo contenente la geometria estrusa
326
+ */ export function estruso(gcad: any, orient: string, hshape: number, shape: any, holes: any[], mats: any[], options: any): THREE.Group;
327
+ /**
328
+ * Crea una geometria estrusa con opzioni avanzate
329
+ * @param {string} orient - Orientamento dell'estrusione
330
+ * @param {number} hshape - Altezza dell'estrusione
331
+ * @param {Object} shape - Forma base
332
+ * @param {Array} holes - Array di fori
333
+ * @param {Array} mats - Array di materiali
334
+ * @param {Object} options - Opzioni di configurazione
335
+ * @returns {THREE.Group} Gruppo contenente la geometria estrusa
336
+ */ export function estrusopat(gcad: any, orient: string, pat: any, shape: any, mats: any[], options: any): THREE.Group;
305
337
  export function evalcustomfunction(amb: any, code: any, values: any, objects: any): Promise<any>;
338
+ export function get3dshape(punti: any, material: any, layer: any): any;
306
339
  export function getOggetto(obj: any, exclude?: any[]): any;
307
340
  export function getbordi(oggetti: any, bordo: any): {
308
341
  bordi: any[];
@@ -313,8 +346,74 @@ export function getbordi(oggetti: any, bordo: any): {
313
346
  br: any;
314
347
  bb: any;
315
348
  };
349
+ export function getbox(gcad: any, x: any, y: any, z: any, mat: any, options: any): any;
350
+ /**
351
+ * Crea un cilindro 3D con orientamento personalizzabile
352
+ * @param {string} ori - Orientamento (X/L, Y/A, Z/P)
353
+ * @param {number} h - Altezza
354
+ * @param {number} r1 - Raggio base
355
+ * @param {number} r2 - Raggio top
356
+ * @param {THREE.Material|Array} mats - Materiale/i da applicare
357
+ * @param {Object} options - Opzioni di configurazione
358
+ * @returns {Promise<THREE.Group>} Gruppo contenente il cilindro
359
+ */
360
+ export function getcilindro(gcad: any, ori: string, h: number, r1: number, r2: number, mats: THREE.Material | any[], options: any): Promise<THREE.Group>;
361
+ export function getcyl(gcad: any, height: any, radius: any, mat: any, options: any): any;
316
362
  export function getdumpmacro(nodo: any): string;
363
+ export function getemitter(data: any): any;
364
+ /**
365
+ * Crea un box 3D con linee di bordo opzionali
366
+ * @param {number} x - Larghezza
367
+ * @param {number} y - Altezza
368
+ * @param {number} z - Profondità
369
+ * @param {THREE.Material} mat - Materiale da applicare
370
+ * @param {Object} options - Opzioni di configurazione
371
+ * @returns {Promise<THREE.Group>} Gruppo contenente il box
372
+ */ export function getface(gcad: any, x: number, y: number, mat: THREE.Material, scaled?: boolean): Promise<THREE.Group>;
373
+ export function getfakeshadow(gcad: any, shape: any, alfa: any): any;
374
+ /**
375
+ * Crea una linea 3D
376
+ * @param {Object} l - Oggetto contenente punti p1 e p2
377
+ * @param {string} id - Identificatore
378
+ * @param {THREE.Material} [mat=null] - Materiale da applicare
379
+ * @returns {THREE.Line} Linea 3D
380
+ */ export function getline(l: any, id: string, mat?: THREE.Material): THREE.Line;
381
+ export function getlinesgeom(edges: any, layer?: number): any;
382
+ export function getmesh(geom: any, material: any, layer?: number, clone?: boolean): any;
383
+ /**
384
+ * Crea un gestore di movimento per animare oggetti 3D.
385
+ * @param {string} key - Chiave identificativa del movimento
386
+ * @param {Array<Object>} gtimeline - Timeline di passi di animazione. Ogni passo può contenere:
387
+ * @param {number} time - Durata del passo in millisecondi
388
+ * @param {(number|function)} [x] - Traslazione X (unità o funzione che restituisce unità)
389
+ * @param {(number|function)} [y] - Traslazione Y
390
+ * @param {(number|function)} [z] - Traslazione Z
391
+ * @param {(number|function)} [s] - Scala uniforme (moltiplicatore)
392
+ * @param {(number|function)} [sx] - Scala X
393
+ * @param {(number|function)} [sy] - Scala Y
394
+ * @param {(number|function)} [sz] - Scala Z
395
+ * @param {(number|function)} [ax] - Rotazione X (in giri)
396
+ * @param {(number|function)} [ay] - Rotazione Y
397
+ * @param {(number|function)} [az] - Rotazione Z
398
+ * @param {(number|function)} [t] - Trasparenza (0-1)
399
+ * @returns {Object} Oggetto gestore del movimento con metodi:
400
+ * @property {number} tline - Durata totale della timeline
401
+ * @property {function} clear - Pulisce la timeline
402
+ * @property {function} add - Aggiunge un passo alla timeline
403
+ * @property {string} key - Chiave del movimento
404
+ * @property {function} step - Esegue un passo dell'animazione
405
+ * @property {function} reset - Resetta l'oggetto alla posizione iniziale
406
+ */ export function getmovimento(key: string, gtimeline?: Array<any>): any;
317
407
  export function getnodebyid(id: any, nodocorrente: any): any;
408
+ export function getpannello(gcad: any, orientamento: any, x: any, y: any, z: any, mat1: any, mat2: any, options: any): any;
409
+ /**
410
+ * Crea un punto 3D rappresentato da una sfera
411
+ * @param {Object} p - Coordinate del punto
412
+ * @param {string} id - Identificatore
413
+ * @param {THREE.Material} [mat=null] - Materiale da applicare
414
+ * @param {number} [size=5] - Dimensione della sfera
415
+ * @returns {THREE.Mesh} Punto 3D
416
+ */ export function getpoint(p: any, id: string, mat?: THREE.Material, size?: number): THREE.Mesh;
318
417
  export function getprojectkeys(project: any): any;
319
418
  /**
320
419
  * Calcola i punti di offset tra due percorsi
@@ -333,6 +432,29 @@ export function getprojectkeys(project: any): any;
333
432
  x: number;
334
433
  y: number;
335
434
  }>;
435
+ export function getpunto(gcad: any, x: any, y: any, z: any, color: string, options: any): Promise<any>;
436
+ /**
437
+ * Crea una quota tra due punti in 3D sul piano XY
438
+ * @param {string} testo - Testo da visualizzare nella quota
439
+ * @param {number} x1 - Coordinata X del primo punto
440
+ * @param {number} y1 - Coordinata Y del primo punto
441
+ * @param {number} x2 - Coordinata X del secondo punto
442
+ * @param {number} y2 - Coordinata Y del secondo punto
443
+ * @param {number} sizetesto - Dimensione del testo
444
+ * @param {Object} options - Opzioni aggiuntive
445
+ * @returns {THREE.Group} Gruppo contenente la quota
446
+ */ export function getquota(gcad: any, testo: string, x1: number, y1: number, x2: number, y2: number, altezza?: number, offset?: number, options?: any): THREE.Group;
447
+ export function getreceiver(gcad: any, data: any): any;
448
+ /**
449
+ * Crea un punto di riferimento invisibile nell'albero 3D
450
+ * @param {number} x - Coordinata X
451
+ * @param {number} y - Coordinata Y
452
+ * @param {number} z - Coordinata Z
453
+ * @param {Object} dati - Dati da archiviare nell'oggetto
454
+ * @param {string} [id=null] - Identificatore opzionale
455
+ * @returns {THREE.Object3D} Oggetto di riferimento invisibile
456
+ */
457
+ export function getriferimento(dati: any, x?: number, y?: number, z?: number, id?: string): THREE.Object3D;
336
458
  /**
337
459
  * Calcola le normali e i valori UV per un percorso chiuso.
338
460
  * @param {Array<Object>} path - Array di punti {x,y}
@@ -366,6 +488,7 @@ export function getprojectkeys(project: any): any;
366
488
  * @method to3d(u0,c,a,b) - Converte in forma 3D con normali
367
489
  */
368
490
  export function getshape(): any;
491
+ export function getsprite(gcad: any, x: any, y: any, z: any, mat: any, options?: {}): any;
369
492
  export function getsubrules(nodocorrente: any): ({
370
493
  id: string;
371
494
  level: number;
@@ -380,19 +503,83 @@ export function getsubrules(nodocorrente: any): ({
380
503
  level: number;
381
504
  })[];
382
505
  /**
383
- * Esegue una semplice somma sincrona di due numeri
384
- * @param {number} a - Primo numero da sommare
385
- * @param {number} b - Secondo numero da sommare
386
- * @returns {number} La somma dei due numeri
387
- */ export function hash(obj: any): number;
506
+ * Crea una targhetta rettangolare con testo
507
+ * @param {Array|string} testo - Array di oggetti {testo, size, colore} o stringa
508
+ * @param {number} dim - Larghezza/altezza della targhetta
509
+ * @param {Object} options - Opzioni aggiuntive
510
+ * @returns {THREE.Mesh} Mesh con la targhetta
511
+ */ export function gettarghetta(gcad: any, testo: any[] | string, dim?: number, options?: any): THREE.Mesh;
512
+ export function groupfromgeometry(geometry: any, material: any, x: any, y: any, z: any, name: any, layer: any): any;
513
+ export function hash(obj: any): string;
514
+ export function infoestrudi(shape: any, hshape: any, pts: any, options: any): {
515
+ aini: any;
516
+ aini2: any;
517
+ afin: any;
518
+ afin2: any;
519
+ pts: any;
520
+ mi: any;
521
+ ma: any;
522
+ rect: {
523
+ x: any;
524
+ y: any;
525
+ }[];
526
+ dimx: number;
527
+ dimy: number;
528
+ lnom: number;
529
+ lmax: number;
530
+ lmin: number;
531
+ lmed: number;
532
+ };
388
533
  export function isfn(row: any): boolean;
389
534
  export function ismacro(row: any): any;
535
+ export let materialline1: any;
536
+ export let materialline2: any;
537
+ export const mblack: any;
538
+ export const mblue: any;
539
+ export const mgray1: any;
540
+ export const mgray2: any;
541
+ export const mgreen: any;
542
+ export const mred: any;
543
+ export const mwhite: any;
544
+ export function newgcad(P: any, _cat: any, islog?: boolean): {
545
+ clearmatricole: () => void;
546
+ islog: boolean;
547
+ clear: () => Promise<void>;
548
+ getScript: (file: any) => Promise<any>;
549
+ checkScripts: (files: any) => Promise<void>;
550
+ gmats: {};
551
+ scripts: () => string[];
552
+ geo: {};
553
+ movs: {};
554
+ textures: {};
555
+ smats: {};
556
+ dump(): void;
557
+ readonly cat: any;
558
+ pushcat(cat: any): void;
559
+ popcat: () => any;
560
+ tex(file: any, sx: number, sy: any, rot: any): Promise<any>;
561
+ get3ds(file: any, callback: any, ky?: string): Promise<any>;
562
+ getglb(file: any, textures: any, callback?: any, ky?: string): Promise<any>;
563
+ };
390
564
  /**
391
565
  * Calcola il vettore normale unitario di un segmento di linea.
392
566
  * @param {Object} p1 - Punto iniziale {x,y}
393
567
  * @param {Object} p2 - Punto finale {x,y}
394
568
  * @returns {Object} Vettore normale unitario {nx,ny}
395
569
  */ export function normal2(p1: any, p2: any): any;
570
+ export function posiziona(grp: any, pos?: {}): any;
571
+ /**
572
+ * Esegue la semplificazione di un poligono (array di punti) combinando
573
+ * l’algoritmo di distanza radiale e l’algoritmo di Ramer–Douglas–Peucker.
574
+ *
575
+ * @param {Array<{x:number,y:number}>} points - Array di punti {x,y} da semplificare.
576
+ * @param {number} [tolerance=1] - Tolleranza di semplificazione: distanza minima consentita
577
+ * (in unità lineari) tra i punti; internamente usata al quadrato per il calcolo
578
+ * (`sqTolerance = tolerance * tolerance`). Valori più grandi rimuovono più punti.
579
+ * @param {boolean} [highestQuality=false] - Se `true`, salta il passaggio di
580
+ * semplificazione radiale e usa solo Douglas–Peucker per massima qualità.
581
+ * @returns {Array<{x:number,y:number}>} Nuovo array di punti semplificato.
582
+ */
396
583
  /**
397
584
  * Crea una curva di Bézier quadratica tra due segmenti di linea.
398
585
  * @param {Object} a1 - Punto iniziale del primo segmento {x,y}
@@ -403,6 +590,10 @@ export function ismacro(row: any): any;
403
590
  * @returns {Array<Object>} Array di punti {x,y} che formano la curva
404
591
  */
405
592
  export function raccordabezier(a1: any, a2: any, b1: any, b2: any, subdivisions?: number): Array<any>;
593
+ export function randombasemat(): any;
594
+ export function revolve(gcad: any, shape: any, orient: any, mat: any, options: any): any;
595
+ export const scaleunit: 0.001;
596
+ export function setLineColorMode(white: any): void;
406
597
  /**
407
598
  * Crea un oggetto per operazioni booleane e manipolazione di forme 2D usando la libreria Clipper
408
599
  * @returns {Object} Oggetto con metodi per operazioni su forme
@@ -411,6 +602,9 @@ export function raccordabezier(a1: any, a2: any, b1: any, b2: any, subdivisions?
411
602
  * @property {Function} unisci - Unisce più forme con gestione di fori e tagli
412
603
  */
413
604
  export function shapeclip(): any;
605
+ export function smat(gcad: any, file: any, op?: {}): Promise<any>;
606
+ export function spritemat(gcad: any, file: any): Promise<any>;
607
+ export function svuotanodo(n: any): void;
414
608
  export function valutagrafica(amb: any, startmacro: any, rulespec: any, progetto: any, fnreload: any): Promise<{
415
609
  oo: any;
416
610
  vari: any;