Skip to content

Commit

Permalink
Update to 1.2.0 Beta
Browse files Browse the repository at this point in the history
Fixed issue #2
  • Loading branch information
Florian Fechner authored and Florian Fechner committed Feb 17, 2018
1 parent 3df0755 commit 07164ed
Show file tree
Hide file tree
Showing 16 changed files with 222 additions and 351 deletions.
30 changes: 27 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
--primary-color: #8bc34a;
--light-primary-color: #cddc39;
--dark-primary-color: #4caf50;

--convex-color: #bbb;
--concarve-color: #eee;
}

body
Expand All @@ -38,10 +41,10 @@
{
#printing-container
{
display: block
display: block;
}

mc-origami
paper-cubes
{
display: none;
}
Expand All @@ -53,9 +56,30 @@
}
}

.concarve
{
fill: var(--concarve-color);
}

.convex
{
fill: var(--convex-color);
}

.tab
{
stroke: black;
}

.void-room
{
stroke: black;
fill: white;
}

</style>

<paper-cubes><paper-cubes>
<paper-cubes></paper-cubes>
<div id="printing-container">Printing...</div>
</body>
</html>
32 changes: 16 additions & 16 deletions main-process/calculateOrigami/block_id_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
},
"2":
{
"north": "dispenser_front_horizontal:180",
"north": "dispenser_front_horizontal:0",
"south": "furnace_top:0",
"top": "furnace_side:0",
"east": "furnace_side:270",
Expand All @@ -214,7 +214,7 @@
},
"3":
{
"south": "dispenser_front_horizontal:0",
"south": "dispenser_front_horizontal:180",
"north": "furnace_top:180",
"top": "furnace_side:180",
"east": "furnace_side:90",
Expand All @@ -223,7 +223,7 @@
},
"4":
{
"east": "dispenser_front_horizontal:90",
"east": "dispenser_front_horizontal:270",
"west": "furnace_top:90",
"top": "furnace_side:90",
"bottom": "furnace_side:270",
Expand All @@ -232,7 +232,7 @@
},
"5":
{
"west": "dispenser_front_horizontal:270",
"west": "dispenser_front_horizontal:90",
"east": "furnace_top:270",
"top": "furnace_side:270",
"bottom": "furnace_side:90",
Expand Down Expand Up @@ -997,7 +997,7 @@
},
"2":
{
"north": "dropper_front_horizontal:180",
"north": "dropper_front_horizontal:0",
"south": "furnace_top:0",
"top": "furnace_side:0",
"east": "furnace_side:270",
Expand All @@ -1006,7 +1006,7 @@
},
"3":
{
"south": "dropper_front_horizontal:0",
"south": "dropper_front_horizontal:180",
"north": "furnace_top:180",
"top": "furnace_side:180",
"east": "furnace_side:90",
Expand All @@ -1015,7 +1015,7 @@
},
"4":
{
"east": "dropper_front_horizontal:90",
"east": "dropper_front_horizontal:270",
"west": "furnace_top:90",
"top": "furnace_side:90",
"bottom": "furnace_side:270",
Expand All @@ -1024,7 +1024,7 @@
},
"5":
{
"west": "dropper_front_horizontal:270",
"west": "dropper_front_horizontal:90",
"east": "furnace_top:270",
"top": "furnace_side:270",
"bottom": "furnace_side:90",
Expand Down Expand Up @@ -1166,7 +1166,7 @@
"2":
{
"north": "observer_front:180",
"south": "observer_back:0",
"south": "observer_back:180",
"top": "observer_top:0",
"east": "observer_side:270",
"bottom": "observer_top:180",
Expand All @@ -1175,7 +1175,7 @@
"3":
{
"south": "observer_front:0",
"north": "observer_back:180",
"north": "observer_back:0",
"top": "observer_top:180",
"east": "observer_side:90",
"bottom": "observer_top:0",
Expand All @@ -1184,7 +1184,7 @@
"4":
{
"east": "observer_front:90",
"west": "observer_back:90",
"west": "observer_back:270",
"top": "observer_top:90",
"bottom": "observer_top:270",
"north": "observer_side:90",
Expand All @@ -1193,7 +1193,7 @@
"5":
{
"west": "observer_front:270",
"east": "observer_back:270",
"east": "observer_back:90",
"top": "observer_top:270",
"bottom": "observer_top:90",
"north": "observer_side:270",
Expand All @@ -1220,7 +1220,7 @@
"10":
{
"north": "observer_front:180",
"south": "observer_back_lit:0",
"south": "observer_back_lit:180",
"top": "observer_top:0",
"east": "observer_side:270",
"bottom": "observer_top:180",
Expand All @@ -1229,7 +1229,7 @@
"11":
{
"south": "observer_front:0",
"north": "observer_back_lit:180",
"north": "observer_back_lit:0",
"top": "observer_top:180",
"east": "observer_side:90",
"bottom": "observer_top:0",
Expand All @@ -1238,7 +1238,7 @@
"12":
{
"east": "observer_front:90",
"west": "observer_back_lit:90",
"west": "observer_back_lit:270",
"top": "observer_top:90",
"bottom": "observer_top:270",
"north": "observer_side:90",
Expand All @@ -1247,7 +1247,7 @@
"13":
{
"west": "observer_front:270",
"east": "observer_back_lit:270",
"east": "observer_back_lit:90",
"top": "observer_top:270",
"bottom": "observer_top:90",
"north": "observer_side:270",
Expand Down
18 changes: 2 additions & 16 deletions main-process/calculateOrigami/calculateOrigami.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function calculateOrigami(data, onCalculationFinished)

parseSchematicFile(data.minecraftSchematicPath, (schema) =>
{
console.log(schema.width, schema.height, schema.length);

let dimension = Math.max(schema.width, schema.height, schema.length);
let voxelData = Array(dimension * dimension * dimension).fill({type: 0, metaType: 0});

Expand All @@ -46,25 +44,15 @@ function calculateOrigami(data, onCalculationFinished)
}

let context = m2o.orthogami(
data.boundsX, data.boundsY, data.scale,
voxelData, dimension, dimension, dimension
);

console.log(context.pages[0].links);

context.strokeWidth = data.strokeWidth;
context.strokeColor = data.strokeColor;
context.tabColor = data.tabColor;
context.pageWidth = data.boundsX;
context.pageHeight = data.boundsY;
context.size = data.scale;
context.texturePath = path.join(data.texturePackPath, "assets/minecraft/textures/blocks");
context.textures = textures;

let template = Handlebars.compile(source);
let html = template(context);



onCalculationFinished(html);
});
});
Expand All @@ -85,7 +73,7 @@ function registerHandlebarsHelper(Handlebars, blockIdList)

Handlebars.registerHelper('div', (a, b) =>
{
return new Handlebars.SafeString(parseInt(parseInt(a) / parseInt(b)));
return new Handlebars.SafeString(parseFloat(a) / parseFloat(b));
});

Handlebars.registerHelper('rotation', (a) =>
Expand Down Expand Up @@ -179,8 +167,6 @@ function parseSchematicFile(fileName, onCalculationFinished)
{
if (error) { throw error; }

console.log("blocks", data.value.Blocks.value);

schematic.width = data.value.Width.value;
schematic.height = data.value.Height.value;
schematic.length = data.value.Length.value;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ std::vector<Page> calculatePages(std::vector<Blueprint*> blueprintVector, std::v
int blueprintWidth = blueprint->getWidth();
int blueprintHeight = blueprint->getHeight();

std::cout << "Offset height: " << offsetHeightThisPage << " rowsPerPage: " << rowsPerPage << " blueprint height: " << blueprintHeight << std::endl;
//std::cout << "Offset height: " << offsetHeightThisPage << " rowsPerPage: " << rowsPerPage << " blueprint height: " << blueprintHeight << std::endl;

if(blueprintHeight + greatestHeightThisRow + 2 > rowsPerPage - offsetHeightThisPage)
{
Expand Down Expand Up @@ -63,7 +63,7 @@ std::vector<Page> calculatePages(std::vector<Blueprint*> blueprintVector, std::v
greatestHeightThisRow = blueprintHeight;
}

std::cout << "Offset width: " << offsetWidthThisPage << " tilesPerRow: " << tilesPerRow << " blueprintWidth: " << blueprintWidth << std::endl;
// std::cout << "Offset width: " << offsetWidthThisPage << " tilesPerRow: " << tilesPerRow << " blueprintWidth: " << blueprintWidth << std::endl;
}

pagesVector.push_back(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ std::vector<Blueprint*> extractBlueprintVectorFromOrthogamiFaceVector(std::vecto
Blueprint* blueprint = new Blueprint(normal);
extractBlueprintVectorFromOrthogamiFaceVectorRecursivly(orthogamiFaceVector, orthogamiEdgeVector, orthogamiFaceMarkedArray, *blueprint, i, 0, 0, matrix);
blueprintVector->push_back(blueprint);
std::cout << "Blueprint size: " << blueprint->getSize() << " width: " << blueprint->getWidth() << " height: " << blueprint->getHeight() << std::endl;
std::cout << "x: " << normal.getX() << " y: " << normal.getY() << " z: " << normal.getZ() << std::endl;
//std::cout << "Blueprint size: " << blueprint->getSize() << " width: " << blueprint->getWidth() << " height: " << blueprint->getHeight() << std::endl;
//std::cout << "x: " << normal.getX() << " y: " << normal.getY() << " z: " << normal.getZ() << std::endl;
blueprintIndex++;
}
}
Expand Down
Loading

0 comments on commit 07164ed

Please sign in to comment.