Skip to content

Commit

Permalink
Rotstep REL/END after rotstep ABS in a multi-step results in wrong ro…
Browse files Browse the repository at this point in the history
…tation #160
  • Loading branch information
trevorsandy committed Dec 3, 2018
1 parent f829af3 commit ca69a35
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -143,9 +143,9 @@ LEGO® is a trademark of the LEGO Group of companies which does not sponsor, aut
[univention-icon]: https://raw.githubusercontent.com/trevorsandy/lpub3d/master/builds/utilities/icons/univention.png
[windows-icon]: https://raw.githubusercontent.com/trevorsandy/lpub3d/master/builds/utilities/icons/windows.png

[windows-url]: https://github.com/trevorsandy/lpub3d/releases/download/v2.3.4/LPub3D-2.3.4.1.1067_20181203.exe
[macos-url]: https://github.com/trevorsandy/lpub3d/releases/download/v2.3.4/LPub3D-2.3.4.1.1067_20181203-macos.dmg
[appimage-url]: https://github.com/trevorsandy/lpub3d/releases/download/v2.3.4/LPub3D-2.3.4.1.1067_20181203-x86_64.AppImage
[windows-url]: https://github.com/trevorsandy/lpub3d/releases/download/v2.3.4/LPub3D-2.3.4.1.1068_20181203.exe
[macos-url]: https://github.com/trevorsandy/lpub3d/releases/download/v2.3.4/LPub3D-2.3.4.1.1068_20181203-macos.dmg
[appimage-url]: https://github.com/trevorsandy/lpub3d/releases/download/v2.3.4/LPub3D-2.3.4.1.1068_20181203-x86_64.AppImage

[arch-url]: https://download.opensuse.org/repositories/home:/trevorsandy/Arch_Extra/
[centos-url]: https://download.opensuse.org/repositories/home:/trevorsandy/CentOS_7/
Expand Down
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Trevor SANDY <trevor[dot]sandy[at]gmail[dot]com>
# Last Update October 02, 2018
pkgname=lpub3d
pkgver=2.3.4.1067
pkgver=2.3.4.1068
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/alldeps/debian/changelog
@@ -1,5 +1,5 @@
lpub3d (2.3.4.1067) debian; urgency=medium
lpub3d (2.3.4.1068) debian; urgency=medium

* LPub3D version 2.3.4.1.1067_20181203 for Linux
* LPub3D version 2.3.4.1.1068_20181203 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 03 Dec 2018 06:49:16 +0100
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 03 Dec 2018 06:52:23 +0100
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.3.4.1067
Version: 2.3.4.1068
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/alldeps/lpub3d.spec
Expand Up @@ -115,7 +115,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.3.4.1067
Version: 2.3.4.1068
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -711,5 +711,5 @@ update-mime-database /usr/share/mime >/dev/null || true
update-desktop-database || true
%endif

* Mon Dec 03 2018 - trevor.dot.sandy.at.gmail.dot.com 2.3.4.1067
* Mon Dec 03 2018 - trevor.dot.sandy.at.gmail.dot.com 2.3.4.1068
- LPub3D Linux package (rpm) release
Binary file modified builds/utilities/ci/secure/.secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/utilities/version.info
@@ -1 +1 @@
2 3 4 1 1067 3fe1177
2 3 4 1 1068 f829af3
2 changes: 1 addition & 1 deletion mainApp/docs/README.txt
@@ -1,4 +1,4 @@
LPub3D 2.3.4.1.1067 (03 12 2018 06:49:16)
LPub3D 2.3.4.1.1068 (03 12 2018 06:52:23)

Features, enhancements, fixes and changes
------------
Expand Down
3 changes: 2 additions & 1 deletion mainApp/docs/RELEASE_NOTES.html
Expand Up @@ -9,7 +9,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.3.4.1.1067 (03 12 2018 06:49:16)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.3.4.1.1068 (03 12 2018 06:52:23)</h4>
<hr>
<p>
LPub3D version 2.3.3<br>
Expand All @@ -35,6 +35,7 @@ <h4><a id="Features_enhancements_fixes_and_changes_7"></a>Features, enhancements
<tr><td class="tg-buh4"><a href="https://github.com/trevorsandy/lpub3d/issues/142">Fix - Line comment colours now working properly #142</a></td></tr>
<tr><td class="tg-0lax"><a href="https://github.com/trevorsandy/lpub3d/issues/143">Fix - Page range dialogue reports false invalid range #143</a></td></tr>
<tr><td class="tg-buh4"><a href="https://github.com/trevorsandy/lpub3d/issues/148">Fix - Submodel instances count setting not set #148</a></td></tr>
<tr><td class="tg-0lax"><a href="https://github.com/trevorsandy/lpub3d/issues/160">Fix - Wrong rotation when rotstep REL/END after rotstep ABS in multi-step #160</a></td></tr>
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.3.0.0.887 (04 09 2018 06:52:44) Release Notes</h4>
Expand Down
2 changes: 1 addition & 1 deletion mainApp/org.trevorsandy.lpub3d.appdata.xml
Expand Up @@ -68,7 +68,7 @@
<binary>lpub3d23</binary>
​</provides>
<releases>
<release version="2.3.4.1067" date="2018-12-03">
<release version="2.3.4.1068" date="2018-12-03">
<description>
<p>LPub3D Linux AppImage package</p>
</description>
Expand Down
17 changes: 10 additions & 7 deletions mainApp/step.cpp
Expand Up @@ -199,7 +199,10 @@ int Step::createCsi(
bool doFadeStep = meta.LPub.fadeStep.fadeStep.value();
bool doHighlightStep = meta.LPub.highlightStep.highlightStep.value() && !gui->suppressColourMeta();
bool invalidIMStep = ((modelDisplayOnlyStep) || (stepNumber.number == 1));
if (meta.rotStep.value().type == "ABS") meta.LPub.assem.cameraAngles.setValues(0.0f,0.0f);
bool absRotstep = meta.rotStep.value().type == "ABS";
FloatPairMeta absCA;
if (absRotstep)
absCA.setValues(0.0f,0.0f);

ldrName.clear();

Expand Down Expand Up @@ -227,8 +230,8 @@ int Step::createCsi(
.arg(resolutionType() == DPI ? "DPI" : "DPCM")
.arg(modelScale)
.arg(meta.LPub.assem.cameraFoV.value())
.arg(meta.LPub.assem.cameraAngles.value(0))
.arg(meta.LPub.assem.cameraAngles.value(1));;
.arg(absRotstep ? absCA.value(0) : meta.LPub.assem.cameraAngles.value(0))
.arg(absRotstep ? absCA.value(1) : meta.LPub.assem.cameraAngles.value(1));

// populate png name
pngName = QString("%1/%2.png").arg(csiPngFilePath).arg(key);
Expand Down Expand Up @@ -280,7 +283,7 @@ int Step::createCsi(
QStringList rotatedParts = csiParts;

// rotate parts for 3DViewer display - do not apply camera angles
if ((rc = renderer->rotateParts(addLine,meta.rotStep,rotatedParts,meta.LPub.assem.cameraAngles,false)) != 0)
if ((rc = renderer->rotateParts(addLine,meta.rotStep,rotatedParts,absRotstep ? absCA : meta.LPub.assem.cameraAngles,false)) != 0)
emit gui->messageSig(LOG_ERROR,QString("Failed to rotate viewer CSI parts"));

// add ROTSTEP command
Expand Down Expand Up @@ -316,7 +319,7 @@ int Step::createCsi(
if (nativeRenderer)
ldrName = csiLdrFile;

if ((rc = renderer->rotateParts(addLine, meta.rotStep, csiParts, ldrName, top.modelName, meta.LPub.assem.cameraAngles)) != 0) {
if ((rc = renderer->rotateParts(addLine, meta.rotStep, csiParts, ldrName, top.modelName, absRotstep ? absCA : meta.LPub.assem.cameraAngles)) != 0) {
emit gui->messageSig(LOG_ERROR,QString("Failed to create and rotate CSI ldr file: %1.")
.arg(ldrName));
return rc;
Expand Down Expand Up @@ -353,8 +356,8 @@ int Step::createCsi(
// set viewer camera options
viewerOptions.ViewerCsiKey = viewerCsiKey;
viewerOptions.FoV = meta.LPub.assem.cameraFoV.value();
viewerOptions.Latitude = meta.LPub.assem.cameraAngles.value(0);
viewerOptions.Longitude = meta.LPub.assem.cameraAngles.value(1);
viewerOptions.Latitude = absRotstep ? absCA.value(0) : meta.LPub.assem.cameraAngles.value(0);
viewerOptions.Longitude = absRotstep ? absCA.value(1) : meta.LPub.assem.cameraAngles.value(1);

// Load the 3DViewer
loadTheViewer();
Expand Down

0 comments on commit ca69a35

Please sign in to comment.