@threepipe/plugin-svg-renderer 0.2.0 → 0.2.1
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/dist/dependencies.txt +2 -2
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/dependencies.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Name: three
|
|
2
|
-
Version: 0.
|
|
2
|
+
Version: 0.153.1003
|
|
3
3
|
License: MIT
|
|
4
4
|
Private: false
|
|
5
5
|
Description: JavaScript 3D library
|
|
@@ -11,7 +11,7 @@ License Copyright:
|
|
|
11
11
|
|
|
12
12
|
The MIT License
|
|
13
13
|
|
|
14
|
-
Copyright © 2010-
|
|
14
|
+
Copyright © 2010-2023 three.js authors
|
|
15
15
|
|
|
16
16
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
17
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
})(this, function(exports2, threepipe, three) {
|
|
4
4
|
"use strict";/**
|
|
5
5
|
* @license
|
|
6
|
-
* @threepipe/plugin-svg-renderer v0.2.
|
|
6
|
+
* @threepipe/plugin-svg-renderer v0.2.1
|
|
7
7
|
* Copyright 2022-2024 repalash <palash@shaders.app>
|
|
8
8
|
* GPLV3 License
|
|
9
9
|
* See ./dependencies.txt for any bundled third-party dependencies and licenses.
|
|
@@ -505,7 +505,6 @@
|
|
|
505
505
|
this.sortObjects = true;
|
|
506
506
|
this.sortElements = true;
|
|
507
507
|
this.overdraw = 0.5;
|
|
508
|
-
this.outputColorSpace = threepipe.SRGBColorSpace;
|
|
509
508
|
this.info = {
|
|
510
509
|
render: {
|
|
511
510
|
vertices: 0,
|
|
@@ -558,7 +557,7 @@
|
|
|
558
557
|
}
|
|
559
558
|
this.clear = function() {
|
|
560
559
|
removeChildNodes();
|
|
561
|
-
_svg.style.backgroundColor = _clearColor.getStyle(
|
|
560
|
+
_svg.style.backgroundColor = _clearColor.getStyle();
|
|
562
561
|
};
|
|
563
562
|
this.render = function(scene, camera) {
|
|
564
563
|
if (camera instanceof threepipe.Camera === false) {
|
|
@@ -568,7 +567,7 @@
|
|
|
568
567
|
const background = scene.background;
|
|
569
568
|
if (background && background.isColor) {
|
|
570
569
|
removeChildNodes();
|
|
571
|
-
_svg.style.backgroundColor = background.getStyle(
|
|
570
|
+
_svg.style.backgroundColor = background.getStyle();
|
|
572
571
|
} else if (this.autoClear === true) {
|
|
573
572
|
this.clear();
|
|
574
573
|
}
|
|
@@ -678,7 +677,7 @@
|
|
|
678
677
|
const light = lights[l];
|
|
679
678
|
const lightColor = light.color;
|
|
680
679
|
if (light.isDirectionalLight) {
|
|
681
|
-
const lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld).normalize();
|
|
680
|
+
const lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld).sub(_normal2.setFromMatrixPosition(light.target.matrixWorld)).normalize();
|
|
682
681
|
let amount = normal.dot(lightPosition);
|
|
683
682
|
if (amount <= 0)
|
|
684
683
|
continue;
|
|
@@ -711,14 +710,14 @@
|
|
|
711
710
|
const path = "M" + convert(v1.x - scaleX * 0.5) + "," + convert(v1.y - scaleY * 0.5) + "h" + convert(scaleX) + "v" + convert(scaleY) + "h" + convert(-scaleX) + "z";
|
|
712
711
|
let style = "";
|
|
713
712
|
if (material.isSpriteMaterial || material.isPointsMaterial) {
|
|
714
|
-
style = "fill:" + material.color.getStyle(
|
|
713
|
+
style = "fill:" + material.color.getStyle() + ";fill-opacity:" + material.opacity;
|
|
715
714
|
}
|
|
716
715
|
addPath(style, path);
|
|
717
716
|
}
|
|
718
717
|
function renderLine(v1, v2, material) {
|
|
719
718
|
const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v2.positionScreen.x) + "," + convert(v2.positionScreen.y);
|
|
720
719
|
if (material.isLineBasicMaterial) {
|
|
721
|
-
let style = "fill:none;stroke:" + material.color.getStyle(
|
|
720
|
+
let style = "fill:none;stroke:" + material.color.getStyle() + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.linewidth + ";stroke-linecap:" + material.linecap;
|
|
722
721
|
if (material.isLineDashedMaterial) {
|
|
723
722
|
style = style + ";stroke-dasharray:" + material.dashSize + "," + material.gapSize;
|
|
724
723
|
}
|
|
@@ -749,9 +748,9 @@
|
|
|
749
748
|
_color2.setRGB(_normal2.x, _normal2.y, _normal2.z).multiplyScalar(0.5).addScalar(0.5);
|
|
750
749
|
}
|
|
751
750
|
if (material.wireframe) {
|
|
752
|
-
style = "fill:none;stroke:" + _color2.getStyle(
|
|
751
|
+
style = "fill:none;stroke:" + _color2.getStyle() + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.wireframeLinewidth + ";stroke-linecap:" + material.wireframeLinecap + ";stroke-linejoin:" + material.wireframeLinejoin;
|
|
753
752
|
} else {
|
|
754
|
-
style = "fill:" + _color2.getStyle(
|
|
753
|
+
style = "fill:" + _color2.getStyle() + ";fill-opacity:" + material.opacity;
|
|
755
754
|
}
|
|
756
755
|
addPath(style, path);
|
|
757
756
|
}
|