@remotion/svg-3d-engine 4.0.528 → 4.0.529

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.
Files changed (2) hide show
  1. package/dist/esm/index.mjs +3 -758
  2. package/package.json +3 -3
@@ -258,764 +258,8 @@ var serializeThreeDReducedInstruction = (instruction) => {
258
258
  throw new Error("Unknown instruction type");
259
259
  };
260
260
  var threeDIntoSvgPath = (instructions) => instructions.map((instruction) => serializeThreeDReducedInstruction(instruction)).join(" ");
261
- // ../paths/dist/esm/index.mjs
262
- var length = {
263
- a: 7,
264
- A: 7,
265
- C: 6,
266
- c: 6,
267
- H: 1,
268
- h: 1,
269
- L: 2,
270
- l: 2,
271
- M: 2,
272
- m: 2,
273
- Q: 4,
274
- q: 4,
275
- S: 4,
276
- s: 4,
277
- T: 2,
278
- t: 2,
279
- V: 1,
280
- v: 1,
281
- Z: 0,
282
- z: 0
283
- };
284
- var chunkExact = (array, instruction) => {
285
- const chunks = [];
286
- const expectedSize = length[instruction];
287
- if (array.length % expectedSize !== 0) {
288
- throw new Error(`Expected number of arguments of SVG instruction "${instruction} ${array.join(" ")}" to be a multiple of ${expectedSize}`);
289
- }
290
- for (let i = 0;i < array.length; i += expectedSize) {
291
- chunks.push(array.slice(i, i + expectedSize));
292
- }
293
- return chunks;
294
- };
295
- var makeInstructions = (arr, instruction, cb) => {
296
- return chunkExact(arr, instruction).map((args) => {
297
- return cb(args);
298
- });
299
- };
300
- var segmentRegExp = /([astvzqmhlc])([^astvzqmhlc]*)/gi;
301
- var numberRegExp = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
302
- var arcNumberRegExp = /[\s,]*([-+]?(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:e[-+]?\d+)?)/iy;
303
- var arcFlagRegExp = /[\s,]*([01])/y;
304
- var parseValues = (args, instructionType) => {
305
- let numbers;
306
- if (instructionType === "A" || instructionType === "a") {
307
- numbers = [];
308
- let match;
309
- let lastIndex = 0;
310
- do {
311
- const regExp = numbers.length % 7 === 3 || numbers.length % 7 === 4 ? arcFlagRegExp : arcNumberRegExp;
312
- regExp.lastIndex = lastIndex;
313
- match = regExp.exec(args);
314
- if (match) {
315
- numbers.push(match[1]);
316
- lastIndex = regExp.lastIndex;
317
- }
318
- } while (match);
319
- const rest = args.slice(lastIndex);
320
- if (!/^[\s,]*$/.test(rest)) {
321
- throw new Error(`Malformed path data: ${instructionType} has an invalid value at "${rest.trim()}"`);
322
- }
323
- } else {
324
- numbers = args.match(numberRegExp);
325
- }
326
- if (!numbers || numbers.length === 0) {
327
- if (instructionType === "Z" || instructionType === "z") {
328
- return [];
329
- }
330
- throw new Error(`Malformed path data: ${instructionType} was expected to have numbers afterwards`);
331
- }
332
- const expectedArguments = length[instructionType];
333
- if (numbers.length % expectedArguments !== 0) {
334
- throw new Error(`Malformed path data: ${instructionType} was expected to have a multiple of ${expectedArguments} numbers, but got "${instructionType} ${numbers.join(" ")} instead"`);
335
- }
336
- return numbers.map(Number);
337
- };
338
- var parsePath = (path) => {
339
- if (!path) {
340
- throw new Error("No path provided");
341
- }
342
- const segments = path.match(segmentRegExp);
343
- if (!segments) {
344
- throw new Error(`No path elements found in string ${path}`);
345
- }
346
- return segments.map((segmentString) => {
347
- const command = segmentString.charAt(0);
348
- const args = parseValues(segmentString.substring(1), command);
349
- if (command === "M" && args.length > 2) {
350
- const segmentsArray = [];
351
- segmentsArray.push({
352
- type: command,
353
- x: args[0],
354
- y: args[1]
355
- });
356
- segmentsArray.push(...makeInstructions(args.slice(2), "L", (numbers) => ({
357
- type: "L",
358
- x: numbers[0],
359
- y: numbers[1]
360
- })));
361
- return segmentsArray;
362
- }
363
- if (command === "m" && args.length > 2) {
364
- const segmentsArray = [];
365
- segmentsArray.push({
366
- type: command,
367
- dx: args[0],
368
- dy: args[1]
369
- });
370
- segmentsArray.push(...makeInstructions(args.slice(2), "l", (numbers) => ({
371
- type: "l",
372
- dx: numbers[0],
373
- dy: numbers[1]
374
- })));
375
- return segmentsArray;
376
- }
377
- if (command === "Z" || command === "z") {
378
- return [
379
- {
380
- type: "Z"
381
- }
382
- ];
383
- }
384
- if (command === "A") {
385
- return makeInstructions(args, command, (numbers) => ({
386
- type: command,
387
- rx: numbers[0],
388
- ry: numbers[1],
389
- xAxisRotation: numbers[2],
390
- largeArcFlag: numbers[3] === 1,
391
- sweepFlag: numbers[4] === 1,
392
- x: numbers[5],
393
- y: numbers[6]
394
- }));
395
- }
396
- if (command === "a") {
397
- return makeInstructions(args, command, (numbers) => ({
398
- type: command,
399
- rx: numbers[0],
400
- ry: numbers[1],
401
- xAxisRotation: numbers[2],
402
- largeArcFlag: numbers[3] === 1,
403
- sweepFlag: numbers[4] === 1,
404
- dx: numbers[5],
405
- dy: numbers[6]
406
- }));
407
- }
408
- if (command === "C") {
409
- return makeInstructions(args, command, (numbers) => ({
410
- type: command,
411
- cp1x: numbers[0],
412
- cp1y: numbers[1],
413
- cp2x: numbers[2],
414
- cp2y: numbers[3],
415
- x: numbers[4],
416
- y: numbers[5]
417
- }));
418
- }
419
- if (command === "c") {
420
- return makeInstructions(args, command, (numbers) => ({
421
- type: command,
422
- cp1dx: numbers[0],
423
- cp1dy: numbers[1],
424
- cp2dx: numbers[2],
425
- cp2dy: numbers[3],
426
- dx: numbers[4],
427
- dy: numbers[5]
428
- }));
429
- }
430
- if (command === "S") {
431
- return makeInstructions(args, command, (numbers) => ({
432
- type: command,
433
- cpx: numbers[0],
434
- cpy: numbers[1],
435
- x: numbers[2],
436
- y: numbers[3]
437
- }));
438
- }
439
- if (command === "s") {
440
- return makeInstructions(args, command, (numbers) => ({
441
- type: command,
442
- cpdx: numbers[0],
443
- cpdy: numbers[1],
444
- dx: numbers[2],
445
- dy: numbers[3]
446
- }));
447
- }
448
- if (command === "H") {
449
- return makeInstructions(args, command, (numbers) => ({
450
- type: command,
451
- x: numbers[0]
452
- }));
453
- }
454
- if (command === "h") {
455
- return makeInstructions(args, command, (numbers) => ({
456
- type: command,
457
- dx: numbers[0]
458
- }));
459
- }
460
- if (command === "V") {
461
- return makeInstructions(args, command, (numbers) => ({
462
- type: command,
463
- y: numbers[0]
464
- }));
465
- }
466
- if (command === "v") {
467
- return makeInstructions(args, command, (numbers) => ({
468
- type: command,
469
- dy: numbers[0]
470
- }));
471
- }
472
- if (command === "L") {
473
- return makeInstructions(args, command, (numbers) => ({
474
- type: command,
475
- x: numbers[0],
476
- y: numbers[1]
477
- }));
478
- }
479
- if (command === "M") {
480
- return makeInstructions(args, command, (numbers) => ({
481
- type: command,
482
- x: numbers[0],
483
- y: numbers[1]
484
- }));
485
- }
486
- if (command === "m") {
487
- return makeInstructions(args, command, (numbers) => ({
488
- type: command,
489
- dx: numbers[0],
490
- dy: numbers[1]
491
- }));
492
- }
493
- if (command === "l") {
494
- return makeInstructions(args, command, (numbers) => ({
495
- type: command,
496
- dx: numbers[0],
497
- dy: numbers[1]
498
- }));
499
- }
500
- if (command === "Q") {
501
- return makeInstructions(args, command, (numbers) => ({
502
- type: command,
503
- cpx: numbers[0],
504
- cpy: numbers[1],
505
- x: numbers[2],
506
- y: numbers[3]
507
- }));
508
- }
509
- if (command === "q") {
510
- return makeInstructions(args, command, (numbers) => ({
511
- type: command,
512
- cpdx: numbers[0],
513
- cpdy: numbers[1],
514
- dx: numbers[2],
515
- dy: numbers[3]
516
- }));
517
- }
518
- if (command === "T") {
519
- return makeInstructions(args, command, (numbers) => ({
520
- type: command,
521
- x: numbers[0],
522
- y: numbers[1]
523
- }));
524
- }
525
- if (command === "t") {
526
- return makeInstructions(args, command, (numbers) => ({
527
- type: command,
528
- dx: numbers[0],
529
- dy: numbers[1]
530
- }));
531
- }
532
- throw new Error(`Invalid path element ${segmentString}`);
533
- }, []).flat(1);
534
- };
535
- var convertQToCInstruction = (instruction, startPoint) => {
536
- const cp1x = startPoint.x + 2 / 3 * (instruction.cpx - startPoint.x);
537
- const cp1y = startPoint.y + 2 / 3 * (instruction.cpy - startPoint.y);
538
- const cp2x = instruction.x + 2 / 3 * (instruction.cpx - instruction.x);
539
- const cp2y = instruction.y + 2 / 3 * (instruction.cpy - instruction.y);
540
- return {
541
- type: "C",
542
- cp1x,
543
- cp1y,
544
- cp2x,
545
- cp2y,
546
- x: instruction.x,
547
- y: instruction.y
548
- };
549
- };
550
- var iterateOverSegments = ({
551
- segments,
552
- iterate
553
- }) => {
554
- let x = 0;
555
- let y = 0;
556
- let initialX = 0;
557
- let initialY = 0;
558
- let cpX = null;
559
- let cpY = null;
560
- const newSegments = segments.map((s, i) => {
561
- const newSeg = iterate({
562
- segment: s,
563
- x,
564
- y,
565
- prevSegment: segments[i - 1] ?? null,
566
- initialX,
567
- initialY,
568
- cpX,
569
- cpY
570
- });
571
- switch (s.type) {
572
- case "M":
573
- initialX = s.x;
574
- initialY = s.y;
575
- x = s.x;
576
- y = s.y;
577
- cpX = null;
578
- cpY = null;
579
- break;
580
- case "Q":
581
- x = s.x;
582
- y = s.y;
583
- cpX = s.cpx;
584
- cpY = s.cpy;
585
- break;
586
- case "A":
587
- x = s.x;
588
- y = s.y;
589
- cpX = null;
590
- cpY = null;
591
- break;
592
- case "C":
593
- x = s.x;
594
- y = s.y;
595
- cpX = s.cp2x;
596
- cpY = s.cp2y;
597
- break;
598
- case "S":
599
- x = s.x;
600
- y = s.y;
601
- cpX = s.cpx;
602
- cpY = s.cpy;
603
- break;
604
- case "T":
605
- if (cpX !== null && cpY !== null) {
606
- cpX = x - (cpX - x);
607
- cpY = y - (cpY - y);
608
- }
609
- x = s.x;
610
- y = s.y;
611
- break;
612
- case "L":
613
- x = s.x;
614
- y = s.y;
615
- cpX = null;
616
- cpY = null;
617
- break;
618
- case "V":
619
- y = s.y;
620
- cpX = null;
621
- cpY = null;
622
- break;
623
- case "H":
624
- x = s.x;
625
- cpX = null;
626
- cpY = null;
627
- break;
628
- case "Z":
629
- x = initialX;
630
- y = initialY;
631
- cpX = null;
632
- cpY = null;
633
- break;
634
- default:
635
- throw new Error(`Unexpected instruction ${s.type}`);
636
- }
637
- return newSeg;
638
- });
639
- return newSegments.flat(1);
640
- };
641
- var TAU = Math.PI * 2;
642
- function approximate_unit_arc(theta1, delta_theta) {
643
- const alpha = 4 / 3 * Math.tan(delta_theta / 4);
644
- const x1 = Math.cos(theta1);
645
- const y1 = Math.sin(theta1);
646
- const x2 = Math.cos(theta1 + delta_theta);
647
- const y2 = Math.sin(theta1 + delta_theta);
648
- return [
649
- x1,
650
- y1,
651
- x1 - y1 * alpha,
652
- y1 + x1 * alpha,
653
- x2 + y2 * alpha,
654
- y2 - x2 * alpha,
655
- x2,
656
- y2
657
- ];
658
- }
659
- function unit_vector_angle(ux, uy, vx, vy) {
660
- const sign = ux * vy - uy * vx < 0 ? -1 : 1;
661
- let dot2 = ux * vx + uy * vy;
662
- if (dot2 > 1) {
663
- dot2 = 1;
664
- }
665
- if (dot2 < -1) {
666
- dot2 = -1;
667
- }
668
- return sign * Math.acos(dot2);
669
- }
670
- function get_arc_center({
671
- x1,
672
- y1,
673
- x2,
674
- y2,
675
- largeArcFlag,
676
- sweepFlag,
677
- rx,
678
- ry,
679
- sin_phi,
680
- cos_phi
681
- }) {
682
- const x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
683
- const y1p = -sin_phi * (x1 - x2) / 2 + cos_phi * (y1 - y2) / 2;
684
- const rx_sq = rx * rx;
685
- const ry_sq = ry * ry;
686
- const x1p_sq = x1p * x1p;
687
- const y1p_sq = y1p * y1p;
688
- let radicant = rx_sq * ry_sq - rx_sq * y1p_sq - ry_sq * x1p_sq;
689
- if (radicant < 0) {
690
- radicant = 0;
691
- }
692
- radicant /= rx_sq * y1p_sq + ry_sq * x1p_sq;
693
- radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1);
694
- const cxp = radicant * rx / ry * y1p;
695
- const cyp = radicant * -ry / rx * x1p;
696
- const cx = cos_phi * cxp - sin_phi * cyp + (x1 + x2) / 2;
697
- const cy = sin_phi * cxp + cos_phi * cyp + (y1 + y2) / 2;
698
- const v1x = (x1p - cxp) / rx;
699
- const v1y = (y1p - cyp) / ry;
700
- const v2x = (-x1p - cxp) / rx;
701
- const v2y = (-y1p - cyp) / ry;
702
- const theta1 = unit_vector_angle(1, 0, v1x, v1y);
703
- let delta_theta = unit_vector_angle(v1x, v1y, v2x, v2y);
704
- if (sweepFlag === false && delta_theta > 0) {
705
- delta_theta -= TAU;
706
- }
707
- if (sweepFlag === true && delta_theta < 0) {
708
- delta_theta += TAU;
709
- }
710
- return [cx, cy, theta1, delta_theta];
711
- }
712
- function arcToCircle({
713
- x1,
714
- y1,
715
- x2,
716
- y2,
717
- largeArcFlag,
718
- sweepFlag,
719
- rx,
720
- ry,
721
- phi
722
- }) {
723
- const sin_phi = Math.sin(phi * TAU / 360);
724
- const cos_phi = Math.cos(phi * TAU / 360);
725
- const x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
726
- const y1p = -sin_phi * (x1 - x2) / 2 + cos_phi * (y1 - y2) / 2;
727
- if (x1p === 0 && y1p === 0) {
728
- return [];
729
- }
730
- if (rx === 0 || ry === 0) {
731
- return [];
732
- }
733
- rx = Math.abs(rx);
734
- ry = Math.abs(ry);
735
- const lambda = x1p * x1p / (rx * rx) + y1p * y1p / (ry * ry);
736
- if (lambda > 1) {
737
- rx *= Math.sqrt(lambda);
738
- ry *= Math.sqrt(lambda);
739
- }
740
- const cc = get_arc_center({
741
- x1,
742
- y1,
743
- x2,
744
- y2,
745
- largeArcFlag,
746
- sweepFlag,
747
- rx,
748
- ry,
749
- sin_phi,
750
- cos_phi
751
- });
752
- const result = [];
753
- let theta1 = cc[2];
754
- let delta_theta = cc[3];
755
- const segments = Math.max(Math.ceil(Math.abs(delta_theta) / (TAU / 4)), 1);
756
- delta_theta /= segments;
757
- for (let i = 0;i < segments; i++) {
758
- result.push(approximate_unit_arc(theta1, delta_theta));
759
- theta1 += delta_theta;
760
- }
761
- return result.map((curve) => {
762
- for (let i = 0;i < curve.length; i += 2) {
763
- let x = curve[i + 0];
764
- let y = curve[i + 1];
765
- x *= rx;
766
- y *= ry;
767
- const xp = cos_phi * x - sin_phi * y;
768
- const yp = sin_phi * x + cos_phi * y;
769
- curve[i + 0] = xp + cc[0];
770
- curve[i + 1] = yp + cc[1];
771
- }
772
- return curve;
773
- });
774
- }
775
- var removeATSHVQInstructions = (segments) => {
776
- return iterateOverSegments({
777
- segments,
778
- iterate: ({ segment, prevSegment, x, y, cpX, cpY }) => {
779
- if (segment.type === "H") {
780
- return [{ type: "L", x: segment.x, y }];
781
- }
782
- if (segment.type === "V") {
783
- return [{ type: "L", x, y: segment.y }];
784
- }
785
- if (segment.type === "A") {
786
- const nextX = segment.x;
787
- const nextY = segment.y;
788
- const new_segments = arcToCircle({
789
- x1: x,
790
- y1: y,
791
- x2: nextX,
792
- y2: nextY,
793
- largeArcFlag: segment.largeArcFlag,
794
- sweepFlag: segment.sweepFlag,
795
- rx: segment.rx,
796
- ry: segment.ry,
797
- phi: segment.xAxisRotation
798
- });
799
- if (new_segments.length === 0) {
800
- return [
801
- {
802
- type: "L",
803
- x: segment.x,
804
- y: segment.y
805
- }
806
- ];
807
- }
808
- const result = new_segments.map((_s) => {
809
- return {
810
- type: "C",
811
- cp1x: _s[2],
812
- cp1y: _s[3],
813
- cp2x: _s[4],
814
- cp2y: _s[5],
815
- x: _s[6],
816
- y: _s[7]
817
- };
818
- });
819
- return result;
820
- }
821
- if (segment.type === "T") {
822
- let prevControlX = 0;
823
- let prevControlY = 0;
824
- if (prevSegment && (prevSegment.type === "Q" || prevSegment.type === "T")) {
825
- prevControlX = cpX;
826
- prevControlY = cpY;
827
- } else {
828
- prevControlX = x;
829
- prevControlY = y;
830
- }
831
- const vectorX = prevControlX - x;
832
- const vectorY = prevControlY - y;
833
- const newControlX = x - vectorX;
834
- const newControlY = y - vectorY;
835
- return [
836
- convertQToCInstruction({
837
- type: "Q",
838
- cpx: newControlX,
839
- cpy: newControlY,
840
- x: segment.x,
841
- y: segment.y
842
- }, { x, y })
843
- ];
844
- }
845
- if (segment.type === "S") {
846
- let prevControlX = 0;
847
- let prevControlY = 0;
848
- if (prevSegment && prevSegment.type === "C") {
849
- prevControlX = prevSegment.cp2x;
850
- prevControlY = prevSegment.cp2y;
851
- } else if (prevSegment && prevSegment.type === "S") {
852
- prevControlX = prevSegment.cpx;
853
- prevControlY = prevSegment.cpy;
854
- } else {
855
- prevControlX = x;
856
- prevControlY = y;
857
- }
858
- const vectorX = prevControlX - x;
859
- const vectorY = prevControlY - y;
860
- const newControlX = x - vectorX;
861
- const newControlY = y - vectorY;
862
- return [
863
- {
864
- type: "C",
865
- cp1x: newControlX,
866
- cp1y: newControlY,
867
- cp2x: segment.cpx,
868
- cp2y: segment.cpy,
869
- x: segment.x,
870
- y: segment.y
871
- }
872
- ];
873
- }
874
- if (segment.type === "Q") {
875
- return [convertQToCInstruction(segment, { x, y })];
876
- }
877
- return [segment];
878
- }
879
- });
880
- };
881
- var normalizeInstructions = (instructions) => {
882
- const normalized = [];
883
- let x = 0;
884
- let y = 0;
885
- let moveX = 0;
886
- let moveY = 0;
887
- for (let i = 0;i < instructions.length; i++) {
888
- const instruction = instructions[i];
889
- if (instruction.type === "M") {
890
- moveX = instruction.x;
891
- moveY = instruction.y;
892
- } else if (instruction.type === "m") {
893
- moveX = x + instruction.dx;
894
- moveY = y + instruction.dy;
895
- }
896
- if (instruction.type === "A" || instruction.type === "C" || instruction.type === "L" || instruction.type === "M" || instruction.type === "Q" || instruction.type === "S" || instruction.type === "T") {
897
- normalized.push(instruction);
898
- x = instruction.x;
899
- y = instruction.y;
900
- continue;
901
- }
902
- if (instruction.type === "a" || instruction.type === "c" || instruction.type === "l" || instruction.type === "m" || instruction.type === "q" || instruction.type === "s" || instruction.type === "t") {
903
- const currentX = x;
904
- const currentY = y;
905
- x += instruction.dx;
906
- y += instruction.dy;
907
- if (instruction.type === "a") {
908
- normalized.push({
909
- type: "A",
910
- largeArcFlag: instruction.largeArcFlag,
911
- rx: instruction.rx,
912
- ry: instruction.ry,
913
- sweepFlag: instruction.sweepFlag,
914
- xAxisRotation: instruction.xAxisRotation,
915
- x,
916
- y
917
- });
918
- continue;
919
- }
920
- if (instruction.type === "c") {
921
- normalized.push({
922
- type: "C",
923
- cp1x: instruction.cp1dx + currentX,
924
- cp1y: instruction.cp1dy + currentY,
925
- cp2x: instruction.cp2dx + currentX,
926
- cp2y: instruction.cp2dy + currentY,
927
- x,
928
- y
929
- });
930
- continue;
931
- }
932
- if (instruction.type === "l") {
933
- normalized.push({
934
- type: "L",
935
- x,
936
- y
937
- });
938
- continue;
939
- }
940
- if (instruction.type === "m") {
941
- normalized.push({
942
- type: "M",
943
- x,
944
- y
945
- });
946
- continue;
947
- }
948
- if (instruction.type === "q") {
949
- normalized.push({
950
- type: "Q",
951
- cpx: instruction.cpdx + currentX,
952
- cpy: instruction.cpdy + currentY,
953
- x,
954
- y
955
- });
956
- continue;
957
- }
958
- if (instruction.type === "s") {
959
- normalized.push({
960
- type: "S",
961
- cpx: instruction.cpdx + currentX,
962
- cpy: instruction.cpdy + currentY,
963
- x,
964
- y
965
- });
966
- continue;
967
- }
968
- if (instruction.type === "t") {
969
- normalized.push({
970
- type: "T",
971
- x,
972
- y
973
- });
974
- continue;
975
- }
976
- }
977
- if (instruction.type === "H") {
978
- normalized.push(instruction);
979
- x = instruction.x;
980
- continue;
981
- }
982
- if (instruction.type === "V") {
983
- normalized.push(instruction);
984
- y = instruction.y;
985
- continue;
986
- }
987
- if (instruction.type === "Z") {
988
- normalized.push(instruction);
989
- x = moveX;
990
- y = moveY;
991
- continue;
992
- }
993
- if (instruction.type === "h") {
994
- x += instruction.dx;
995
- normalized.push({
996
- type: "H",
997
- x
998
- });
999
- continue;
1000
- }
1001
- if (instruction.type === "v") {
1002
- y += instruction.dy;
1003
- normalized.push({
1004
- type: "V",
1005
- y
1006
- });
1007
- continue;
1008
- }
1009
- throw new Error("Unknown instruction type: " + instruction.type);
1010
- }
1011
- return normalized;
1012
- };
1013
- var reduceInstructions = (instruction) => {
1014
- const simplified = normalizeInstructions(instruction);
1015
- return removeATSHVQInstructions(simplified);
1016
- };
1017
-
1018
261
  // src/fix-z.ts
262
+ import { reduceInstructions } from "@remotion/paths";
1019
263
  var turnInto3D = (instructions) => {
1020
264
  let lastMove = [0, 0, 0, 1];
1021
265
  const newInstructions = [];
@@ -1053,6 +297,7 @@ var turnInto3D = (instructions) => {
1053
297
  };
1054
298
 
1055
299
  // src/map-face.ts
300
+ import { parsePath, reduceInstructions as reduceInstructions2 } from "@remotion/paths";
1056
301
  var translateSvgInstruction = (instruction, x, y, z) => {
1057
302
  if (instruction.type === "M") {
1058
303
  return {
@@ -1134,7 +379,7 @@ var transformPath = ({
1134
379
  transformation
1135
380
  }) => {
1136
381
  const parsed = parsePath(path);
1137
- const reduced = reduceInstructions(parsed);
382
+ const reduced = reduceInstructions2(parsed);
1138
383
  const threeD = turnInto3D(reduced);
1139
384
  return threeDIntoSvgPath(threeD.map((p) => {
1140
385
  return multiplyMatrixAndSvgInstruction(transformation, p);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@remotion/svg-3d-engine",
3
3
  "dependencies": {
4
- "@remotion/paths": "4.0.528"
4
+ "@remotion/paths": "4.0.529"
5
5
  },
6
6
  "devDependencies": {
7
- "@remotion/eslint-config-internal": "4.0.528",
7
+ "@remotion/eslint-config-internal": "4.0.529",
8
8
  "eslint": "9.19.0",
9
9
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
10
10
  },
@@ -24,7 +24,7 @@
24
24
  "require": "./dist/cjs/index.js"
25
25
  }
26
26
  },
27
- "version": "4.0.528",
27
+ "version": "4.0.529",
28
28
  "repository": {
29
29
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/svg-3d-engine"
30
30
  },