fix small bugs in isometric projection

This commit is contained in:
Mario Voigt 2024-07-02 21:06:11 +02:00
parent 4de1090640
commit 865510ce33
3 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@
<option value="right">Dimetric right-hand side</option>
</param>
<param name="reverse" type="bool" gui-text="Reverse transformation">false</param>
<param name="orthoangle" type="float" precision="3" min="0.000" max="90.000" gui-text="Orthographic angle">15.000</param>
<param name="orthoangle" type="float" precision="3" min="0.001" max="90.000" gui-text="Orthographic angle">15.000</param>
<effect>
<object-type>all</object-type>
<effects-menu>

View File

@ -8,7 +8,7 @@
<option value="right">Isometric right-hand side</option>
</param>
<param name="reverse" type="bool" gui-text="Reverse transformation">false</param>
<param name="orthoangle" type="float" precision="3" min="0" max="90" gui-text="Orthographic angle">30.000</param>
<param name="orthoangle" type="float" precision="3" min="0.001" max="90.000" gui-text="Orthographic angle">30.000</param>
<effect>
<object-type>all</object-type>
<effects-menu>

View File

@ -67,6 +67,9 @@ class IsometricProjection(inkex.EffectExtension):
self.arg_parser.add_argument('--orthoangle', type=float, default=15.0, help='Isometric angle in degrees')
def __initConstants(self, angle):
if angle == 0:
inkex.utils.debug("angle is set to 0°. This is not supported")
return
# Precomputed values for sine, cosine, and tangent of orthoangle.
self.rad = math.radians(angle)
self.cos = math.cos(self.rad)