gradientspace / gsslicer Goto Github PK
View Code? Open in Web Editor NEW3D printing slicer
License: MIT License
3D printing slicer
License: MIT License
Hi, I've been trying to test out your slicer in a windows form application.
Pretty basic one, just a button to generate a Gcode from the exemple given on your website :
`
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using g3;
using gs;
using gs.info;
namespace SlicingApp
{
public partial class Form1 : Form
{
public static SingleMaterialFFFSettings LastSettings;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
CappedCylinderGenerator cylgen = new CappedCylinderGenerator()
{
BaseRadius = 10,
TopRadius = 5,
Height = 20,
Slices = 32
};
DMesh3 mesh = cylgen.Generate().MakeDMesh();
MeshTransforms.ConvertYUpToZUp(mesh); // g3 meshes are usually Y-up
// center mesh above origin
AxisAlignedBox3d bounds = mesh.CachedBounds;
Vector3d baseCenterPt = bounds.Center - bounds.Extents.z * Vector3d.AxisZ;
MeshTransforms.Translate(mesh, -baseCenterPt);
PrintMeshAssembly meshes = new PrintMeshAssembly();
meshes.AddMesh(mesh);
GenerateGCodeForMeshes(meshes);
}
static string GenerateGCodeForMeshes(PrintMeshAssembly meshes)
{
// configure settings
//RepRapSettings settings = new RepRapSettings(RepRap.Models.Unknown);
MakerbotSettings settings = new MakerbotSettings(Makerbot.Models.Replicator2);
LastSettings = settings.CloneAs<SingleMaterialFFFSettings>();
MeshPlanarSlicer slicer = new MeshPlanarSlicer()
{
LayerHeightMM = settings.LayerHeightMM
};
slicer.Add(meshes);
PlanarSliceStack slices = slicer.Compute();
SingleMaterialFFFPrintGenerator printGen =
new SingleMaterialFFFPrintGenerator(meshes, slices, settings);
if (printGen.Generate())
{
// export gcode
GCodeFile gcode = printGen.Result;
using (StreamWriter w = new StreamWriter("generated.gcode"))
{
StandardGCodeWriter writer = new StandardGCodeWriter();
writer.WriteFile(gcode, w);
}
}
return "";
}
}
}`
Even though I'm almost using the exact same code as the one in your tutorial, my result is kinda weird, the following screenshot is the Gcode displayed in PronterFace :
So there is space between my layers and it looks like no shells are rendered as you can see here :
The whole slicing looks messed up, Any idea why this happens ?
PS : sorry for bad englendo and formatting!
hi,
i need some assistance in understanding following parameters :
what is the use case for these parameters?
Regards,
When I using the attched example, all the fine
CappedCylinderGenerator cylgen = new CappedCylinderGenerator() {
BaseRadius = 10, TopRadius = 5, Height = 20, Slices = 32
};
DMesh3 mesh = cylgen.Generate().MakeDMesh();
MeshTransforms.ConvertYUpToZUp(mesh); // g3 meshes are usually Y-up
Attempt to generate gcode for this mesh:
Converted from unity mesh by using this function:
public static DMesh3 ToDMesh3(this Mesh mesh) {
DMesh3 result = new DMesh3();
result.BeginUnsafeTrianglesInsert();
var indices = mesh.GetIndices(0);
var polygons = new List<Polygon>();
var verts = mesh.vertices;
for(int i = 0; i < indices.Length / 3; i++) {
var v0 = verts[indices[i * 3 + 0]];
var v1 = verts[indices[i * 3 + 1]];
var v2 = verts[indices[i * 3 + 2]];
result.AppendTriangle(
result.AppendVertex(new Vector3d(v0.x, v0.y, v0.z)),
result.AppendVertex(new Vector3d(v1.x, v1.y, v1.z)),
result.AppendVertex(new Vector3d(v2.x, v2.y, v2.z))
);
}
result.EndUnsafeTrianglesInsert();
return result;
}
Resulted in gcode that have no any infill:
STL is watertight.
What I am doing in wrong way?
Feature Request
The project Escher was a great idea, but the slicer on netfabb is very limited, one of the main flaws is the lack of double extruder for support material. Would be great to have this capability on this slicer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.