Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleanup: Draw grayscale colors based on number of layers, tie bg of P…

…OV and depth map sample.
  • Loading branch information...
commit fd91f045b04cf0bd11c268e6891be88a641f0cef 1 parent 62a2a61
Matthew Mets authored
2  KinectToStl/src/simpleSkein.cpp
@@ -294,7 +294,7 @@ void SimpleSkein::skeinDepthMap(int height, int width, float* pixels) {
294 294
 		unsigned char charLayerPixels[height*width];
295 295
 		for (uint i = 0; i < height*width; i++) {
296 296
 			if (pixels[i] < getHeightForSample(step)) {
297  
-				charLayerPixels[i] = 255;
  297
+				charLayerPixels[i] = (255/numSamples);
298 298
 			}
299 299
 			else {
300 300
 				charLayerPixels[i] = 0;
16  KinectToStl/src/simpleSkein.h
... ...
@@ -1,4 +1,20 @@
1 1
 /*
  2
+ *  SimpleSkein: A direct Kinect-to-Gcode converter
  3
+ *
  4
+ *  Created By Matt Mets during Art&&Code 3D
  5
+ *  Based on Kyle McDonald's KinectToSTL
  6
+ *
  7
+ *  Available online at:
  8
+ *
  9
+ *  https://github.com/cibomahto/Makerbot-1
  10
+ */
  11
+
  12
+
  13
+
  14
+
  15
+
  16
+
  17
+/*
2 18
  *  simpleSkein.h
3 19
  *  KinectToStl
4 20
  *
10  KinectToStl/src/testApp.cpp
@@ -60,9 +60,7 @@ void testApp::setup() {
60 60
 	ofSetVerticalSync(true);
61 61
 	
62 62
 	panel.setup(250, 800);
63  
-	panel.addPanel("STL");
64  
-	panel.addSlider("minDepth", 30, 10, 150);
65  
-	panel.addSlider("maxDepth", 80, 10, 150);
  63
+	panel.addPanel("Camera");
66 64
 	panel.addSlider("numSamples", 10, 1, 160);
67 65
 	panel.addSlider("numShells", 1, 2, 15);
68 66
 	panel.addSlider("infillGridSize", 40, 5, 80);
@@ -72,7 +70,9 @@ void testApp::setup() {
72 70
 	panel.addToggle("showSliceContours", true);
73 71
 	panel.addToggle("showInfillImages", true);
74 72
 	panel.addToggle("showInfillContours", true);
  73
+
75 74
 	
  75
+	panel.addSlider("minDepth", 30, 10, 150);
76 76
 	panel.addSlider("zCutoff", 80, 20, 200);
77 77
 	panel.addSlider("fovWidth", .5, 0, 1);
78 78
 	panel.addSlider("fovHeight", .75, 0, 1);
@@ -146,7 +146,7 @@ void testApp::update() {
146 146
 	
147 147
 	startTimer();
148 148
 	simpleSkein.minScanDepth = panel.getValueF("minDepth");
149  
-	simpleSkein.maxScanDepth = panel.getValueF("maxDepth");
  149
+	simpleSkein.maxScanDepth = panel.getValueF("zCutoff");
150 150
 	simpleSkein.numSamples = panel.getValueF("numSamples");
151 151
 	simpleSkein.numShells = panel.getValueF("numShells");
152 152
 	simpleSkein.infillGridSize = panel.getValueF("infillGridSize");
@@ -221,7 +221,7 @@ void testApp::update() {
221 221
 #ifndef OFFLINE_TEST
222 222
 		startTimer();
223 223
 		simpleSkein.minScanDepth = panel.getValueF("minDepth");
224  
-		simpleSkein.maxScanDepth = panel.getValueF("maxDepth");
  224
+		simpleSkein.maxScanDepth = panel.getValueF("zCutoff");
225 225
 		simpleSkein.numSamples = panel.getValueF("numSamples");
226 226
 		simpleSkein.numShells = panel.getValueF("numShells");
227 227
 		simpleSkein.infillGridSize = panel.getValueF("infillGridSize");
2  KinectToStl/src/testApp.h
@@ -15,7 +15,7 @@ using namespace cv;
15 15
 #include "ofxReplicatorG.h"
16 16
 #endif
17 17
 
18  
-#define OFFLINE_TEST
  18
+//#define OFFLINE_TEST
19 19
 
20 20
 // constant scale regardless of size
21 21
 // oriented correctly and sitting against the bed

0 notes on commit fd91f04

Please sign in to comment.
Something went wrong with that request. Please try again.