Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scenerygraphics/sciview
Browse files Browse the repository at this point in the history
  • Loading branch information
kephale committed Oct 16, 2020
2 parents ac00bba + 17cade6 commit 0b56cb5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ branches:
- master
- "/.*-[0-9]+\\..*/"
install: true
git:
depth: false
script:
#- ".travis/build.sh"
- "python3 .travis/pre_ci.py"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>deploy-to-scijava</releaseProfiles>

<scenery.version>b9c44a2</scenery.version>
<scenery.version>242d9cf</scenery.version>
<!-- <scijava-common.version>2.84.0</scijava-common.version>-->

<kotlin.version>1.4.10</kotlin.version>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/sc/iview/SciView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,8 @@ public void writeSCMesh( String filename, Mesh scMesh ) {
out = new BufferedOutputStream( new FileOutputStream( f ) );
out.write( "solid STL generated by FIJI\n".getBytes() );

FloatBuffer normalsFB = scMesh.getNormals();
FloatBuffer verticesFB = scMesh.getVertices();
FloatBuffer normalsFB = scMesh.getNormals().duplicate();
FloatBuffer verticesFB = scMesh.getVertices().duplicate();

while( verticesFB.hasRemaining() && normalsFB.hasRemaining() ) {
out.write( ( "facet normal " + normalsFB.get() + " " + normalsFB.get() + " " + normalsFB.get() +
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/sc/iview/commands/process/Isosurface.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
package sc.iview.commands.process;

import graphics.scenery.HasGeometry;
import graphics.scenery.Node;
import net.imagej.mesh.Mesh;
import net.imagej.ops.OpService;
Expand All @@ -36,6 +37,7 @@
import net.imglib2.img.Img;
import net.imglib2.type.logic.BitType;
import net.imglib2.type.numeric.RealType;
import org.joml.Vector3f;
import org.scijava.command.Command;
import org.scijava.plugin.Menu;
import org.scijava.plugin.Parameter;
Expand Down Expand Up @@ -82,7 +84,8 @@ public void run() {
Mesh m = ops.geom().marchingCubes(bitImg, 1, new BitTypeVertexInterpolator());

Node scMesh = sciView.addMesh(m);

((HasGeometry)scMesh).recalculateNormals();
scMesh.setScale(new Vector3f(0.001f, 0.001f, 0.001f));
}

}

0 comments on commit 0b56cb5

Please sign in to comment.