Category Archives: STL files

Preform not (yet) fully compatible with JewelCAD

The challenge

I’ve done some test prints for someone in the jewel industry. They wanted to see the Form1 quality output to maybe use it as a quick prototyping desktop station and get faster development cycles. We discovered that in some conditions JewelCAD is only capable of exporting to STL the positive geometries OR the negative geometries (holes / notch) but not the fused triangle mesh.

The only way to merge both negative and positive geometry is apparently to slice the object and export it as SLC file. This file format was created in 1994 by 3D systems and is now at the second revision. The evolution was mainly to store the data as binary to save space but the content of the file was not changed much.

Preform is unfortunately not capable of reading SLC files nor importing positive and negative bodies to form a finite model. That’s another instance where it would be handy to have the Printer protocol open or at least an API to build our own slicer for the Form1.

Workaround proposals

I can see two ways to solve this challenge:

  1. Use a 3D modeling software to apply the boolean operation
  2. Re-constuct the STL triangle mesh from the SLC slices data

The first option can be done using the free software Blender (see this video tutorial for example). Boolean operations on complex triangles mesh are some time not possible to apply. It’s especially true if the original geometries are not completely clean (holes / inverted triangles…). In the case of my test print, Blender and Netfabb were not able to apply the subtraction.

The picture under is showing that even in a very simple case, subtracting a sphere from a cube in Blender creates a lot of extra triangles. The whole difficulty is to generate precisely the cut/intersection line as explained in this paper by Biermann and Al.

simpleBoolExample

So if the Boolean operation is not possible, we can only regenerate the STL triangles from the SLC data. Provided the original geometry slice thickness was at least the desired print configuration, it should not affect the output quality. Commercial software like SLC2STL or Netfabb seems to be able to perform the conversion but the licenses are expensive for a casual usage (in the $k range).

As the triangle geometry is an interesting algorithm development, I have no option but add it to my TODO list! The first step of this un-slicer is of course to read the SLC data.

Matlab SLC file reader

The SLC format is a simple collection of slices composed of a collection of boundaries. You can read the format specification [here]. Each boundary is a closed polygon (poly-line) defined by a series of [X,Y] vertices with the first point duplicated at the end to close the loop.

I’ve built an viewer in Matlab to explore the content of SLC v2 files. The archive contains 2 example ring slices SLC file. After extracting all the information, the viewer displays a 2 plot window were the user can click on any point in the 3D plot on the right to display the full slice on the left pane.

SLC_view_Ring1

SLC_view_Ring2

The second picture is showing that external (blue) and internal (red) boundaries are drawn in 2 colors. In the SLC format, internal boundaries are stored clockwise while external boundaries are anti-clockwise. Detect reliably the orientation of a poly-line curve is tricky as it must work for concave polygon. The easiest method is to find one point of the convex hull and use a determinant to get the local convexity…

convexPolygonOrientation

concavePolygonOrientation

What’s next?

So while we could dream to have Preform reading the slice directly, it’s probably easier to get one of these software to convert the SLC to STL. This operation is definitely not obvious with many steps to get it working is all circumstances so I probably won’t tackle it anytime soon…

[<<Prev. – Episode 2 : Form1 calibration]    [3D Printer articles]   [Precision VS Accuracy – Next>>]

Episode 2 : Form1 calibration strikes back

[March 11th edit : these calibrations issues were enough to convince me to sell my Form1 printer, for details see this post]

In a previous post I was showing my Form1 was not really well calibrated and circles were turned into ellipses. After filling a bug report to Formlabs, their answer was on the line of “thanks for your concern we are working on it…”

I’m confident they will find a solution, but I started to wonder how a user could calibrate his printer himself. This is important as the warranty on the printer is only valid for 3 months and as any mechanical machine, I’m expecting the printer will require some calibration from time to time. Last but not least, this will be only possible if Formalbs is actually giving us access to more parameters than the currently closed/dumb down version of PreForm we have (Hint! Hint!).

Laser+Galvo based printer calibration challenge

A normal user has limited resources and not access to complex measure instrument, so the procedure should match these requirements:

  • Simple steps: if possible it should be as simple as print test objects, measure them, compute the corrective factors (Excel Spreadsheet/integrated to PreForm), enter the new parameters and re-print the test objects to validate the calibration.
  • Not too long and costly: printed test object should be small, we don’t want to waste time and resin
  • No expensive measure instruments: I’ll be only using a digital caliper available for less than $50 on Ebay/Amazon

My main assumption for this exercise is that the calibration required is only affecting linear parameters. I will not go into galvanometer fine tuning. We will see at the end of the article that unfortunately non-linearity are present and will limit your end result quality.

The main challenge with laser base printer is that it’s difficult to measure precisely the position of a moving dot at the bottom of the vat (absolute measurements). So one solution is to do relative measurements of printed object features. We will use a digital caliper to get a good number of data points to build a robust average estimation of the calibration.

In the graph under, you can see that the laser spot is covering each each slices of the object using two kind of paths. The perimeter/skin-paths are tracing the outline of the object, they will be responsible for the smooth finish. The In-fill paths are straight and parallel paths to cure the inside of each slice. Using simple shapes like circles and square will let us measure independently the performances of both X and Y axis galvanometers.

calibrationExplained1

The final dimension of the Slice is affected by both the axis amplification (deflection angle range) and the size/shape of the laser spot. When tracing the measures VS the theory graphs, the amplification correction is measured by the slope of the curve, while the shape of the laser spot is creating a constant offset.

calibrationExplained2

As PreForm software is not open source, I cannot be sure how to use these correction factors. For the amplification, it will probably mean the angles transmitted to the printer will need to be multiplied by the correction alpha found (different on each axis) . The offset is a consequence of the spot size mismatch. PreForm must use a boundary offset to draw the perimeter/skin paths. A positive offset means that the diameter of the spot need to be reduced by half of the value. Also if the laser spot is not exactly round it might be trickier to program…

Calibration object and Procedure proposal

The shape I used for my calibration is a simple series of square and circle extrusions of various small size and one large for the base. Each instance of the object provides 20 points of measures:
– Circles: [1, 2, 3, 4, 23] mm diameters, X and Y axis
– Square: [3, 4, 5, 6, 25] mm side length, X and Y axis

Cylinder_dimensions

To know where each object was printed on the platform, I’ve added a number engraved. That could be useful later if we are tracking non linearity issue depending on the location of the objects.

[STL & Inventor files for all squareCylinders Test] [5x .form file] [9x .form file]

I’ve used the 5 duplications file as it’s already providing 100 measure points. The base of the object is 3mm thick as I was hoping I could print it without supports to save time and resin. It turn out the Form1 is curing multiple times the slices in the first 2mm for the base. It creates an adhesion issue for the next layers, and I ended up with unusable objects with holes so I’m now generating support structures.

x5Cylinder_platformPosition

Here are my measures, with the 5x file, transparent 100micron material profile and default supports configuration. My first prints were done with the 0.8.1 software but reading that the 0.8.2 is supposed to have an improved laser tracking I decided to reprint everything. (Un?)fortunately the measures are consistent and the 0.8.2 didn’t improve the calibration…

Measure_x5Cylinder_0-8-2

The full spreadsheets with regression formulas are here [0.8.1] and [0.8.2].

x5Cylinder_calibration_results

From the regressions results we can see that the calibration required is consistent in both PreForm version. My printer has a 1.4% error in X axis and 0.35% error in Y. The laser spot diameter is also off by 0.2 mm.

For some reason the PreForm 0.8.2 is less consistent than the 0.8.1, the calibration is only reducing the overall error by a factor of 4 while it was reduced by 5 in the previous version…

Ain’t you doing anything about outliers?

When doing a root cause analysis on anything, you have to solve the first order issues that are dominating your calibration errors before looking at the rest. My Form1 is displaying non linearity on the X axis on geometries close to the back of the platform (2 = back-right and 5 = back-left).

cylinderX5_nonLinearity

When you look at the measures table, both objects are very different from the rest. I have no explanation yet for that phenomenon, but I hope that once I will be able to correct the offset and scale in PreForm I can build a new test to tackle this issue.

Until then, if you have a Form1 I would be glad to ear if your printer has the same calibration issue as mine. More reports will help Formlabs building a great printer!

[<<Prev. – Extract STL from PreForm Files]    [3D Printer articles]   [Preform & JewelCAD – Next>>]

Extract STL from Preform project files

The Form1 printer is supposed to be a click and print easy consumer solution. You get a sleek hardware (that still needs some tuning) and a polished software (Preform) that does not let you tweak a lot’s of options. So if for some reason the auto-generated supports are not working or you want to use a non-official polymer, then you are locked by the closed nature of the product.

When I’ve discussed with Formlabs during the SF Maker Fair, they confirmed they had no intention to release the USB protocol and the .FORM file format specification. The result is that if you want to use a Linux OS or another slicer, you are restricted (ex: generate internal supports function does not exist in Preform yet). These limitations do not exist with the B9 printer, as they decided to release everything as open source.

So what can be done? Well we are limited to reverse-engineer the FORM file or the USB protocol. It’s tedious and random: the end result is not guarantied but by doing so You can learn things about the Form1 and maybe fix some short-coming. A few stuff that open protocol/file could do:

  • enable other OS (no need to use visualization in Linux for ex)
  • custom slicer to fine control the supports, generated path, calibratio
  • Compatibility with different resin/polymer by adjusting the curing parameters
  • new cool features like the vat-fogging map

Anyway, with this post let’s start simple by extracting the STL meshes embedded in the .FORM files.

Extracting STL Mesh data from the .FORM

Using  something like Frhed free HEX editor let you peak at the file content, and a little bit a search gives this 80 characters string with “stl” inside… Yes this is, if you remember the STL file format the first field of a binary format file.

formSTLHeader

And when you duplicate the same object, or add another STL, you can see that each STL instance is stored in the .FORM file. More interesting is the fact that preform keeps the STL in its original dimension and orientation. So you can see that even if I scaled and rotated one of the pieces (from here), the extracted STL shows the supports scaled and with an angle.

multiSTLinMesh_rotateNScale

This is telling us, that somewhere in the meta data of the .FORM file you have the position, rotation and scale information. This is stored in binary (not text) format and thus is more complex to extract. I might try to find where it is stored in a later version of my STL extraction program.

The Utility to extract STL mesh data from .FORM files is coded in plain C, so you should be able to recompile it on anything without much issues. The current EXE was compiled using Visual Studio Express 2010 x86, so you might need to install the VS 2010 redistribuable package before using it.

Utility usage is: extractSTL xxx.form
This will extract the STL meshes and save them in “xxx.form_meshN.stl”

The EXE, source code and VS project files are available here.

Happy forming!

[<<Prev. – Form1 might need calibration]    [3D Printer articles]   [Form1 Calibration Procedure – Next>>]

First steps with the Form 1 Printer

So here it is after many months of waiting the Form1 Stereo printer is sent to backers! and I received a few days ago my puppy, and now the 3D touch has some serious competition.

More on that later, but I’m thinking on selling my 3D touch printer with ~15 filament spools of various colors/materials. So If you are interested mail me, free training included if you are in the bay area 🙂

I will not do a full tear down of the printer, but if you are interested to see the guts of the form1 Bunnie’s blog has an interesting post.

cartboardWith3dTouch

The cardboard boxes are massive and Formlabs decided to avoid foam or bubble wrap to lock the printer in place. The printer was held by 2 plastic films, but you can see in the picture under that during transport it shifted out of the slot. Nothing serious in my case but I have already read some reports of people complaining they received their printer damaged. I’m not exactly sure if this packing method is completely fool proof, especially if the box are rotated during transport/handling.

InsideCartboardBox

The unpacking was really easy, just a few tape pieces to remove… But dang, that’s a sharp looking printer! I’m especially impressed by the build quality. As you can see in the following pictures, they didn’t try to cut on the details. The only small remark I’ve is that the printer detect when the orange hood is closed using a hall sensor and from time to time the magnet is not completely aligned so you need to fiddle/move a bit the hood to get it detected.

Form1ReadyToOperate form1BuildQuality

Now let’s move onto the printing. The samples I’ve seen during the Maker Fair were great but I have to say I feel the Preform software (V0.8.1 at the moment of writing) is still somehow limited and you need to practice a bit to understand how to get the best out of your printer.

My first test was a 25 microns print of one of the Cyvasse game piece but for some reason the support (surface of ~ 2 * 1cm) was not sticking to the platform and the cured resin ended up floating in the tank… So after 2 tries and a fishing party to retrieve the layers, I decided to start with something easier and stick with the default 50 microns layers for the moment.

My first success was with a pocket monster figurine by Andreas. I’ve scaled it down to 50% (.form file) and the result is quite stunning when you are used to the FDM quality. Once cleaned from the resin with alcohol and dry the pieces are a bit cloudy and not very shinny (left picture). I used a Varathane Gloss polyurethane water based spray (interior / Heavy Use Formula) to get a great shine (right picture). With one layer, the details are not lost and you really have the impression that it’s made of crystal.PocketMonster

After that, I was ready to test the limits of the printer. So I tried the simplest structure I could find on George Hart math page. When processed by Preform, the Goldberg polyhedron (.form file) had a large red/unsupported ring area but I decided to print it anyway…goldbergSphereError

It didn’t worked out and I could just  clean up the mess after. golbergFailOnTheTray

As you can see the resin is rather flexible and not fully cured after print. I couldn’t remove the remaining of the sphere from the support without tearing the sphere in half. So lesson 1 is: don’t pull 1mm thick walls… Maybe I should have tried to wash the result and wait until dry?golbergFailFlexibleResin

I was surprised to see how flexible the resin is after print, so I’ve put some of my failed pieces outside in the sun to see how the resin age. As you can see under, after the prints, the parts are white, but just 2 days outside (gyroid – top right) and the resin is much harder/cured but with a yellowish tint. After 4 days (sphere – top left) the tint is even stronger and  all the flex is gone, the cured resin is actually very stiff.form1_aging_resin

Now let’s have a look at print defects that you can get with the form1…

I’d like like to stress that Formlabs team is making progress and the new Preform software revision (0.8.1) is actually solving one of the issues, each layers had a visible seam but the new cleared that point.

seam_form1_defects

Visible seams in Preform 0.8 (Releaux spheres print in 50 microns)

These seams were visible but you couldn’t feel them on the surface so it was more a cosmetic defects. The real issue comes when some parts of the print are not cured properly. In this case the end result is rather ugly on some sides…

reuleaux_form1_defects_0-8-1

Reuleaux Spheres printed with 0-8-1 (50 microns, default generated supports)

To conclude this post, I have to say the form1 is an impressive printer, the details of the parts are great and the build quality is stellar. That said, I know being an early adopters has its disadvantage and even if the printing process is not yet “plug-and-print”, I have high hopes for the future!

[<<Prev. – NA]    [3D Printer articles]   [Preform 0.8.1 – Next>>]

Mass Customization and Fast Prototyping Age?

This article is less about technique and more about thoughts that I had while designing my last project. It was based on an idea I had a few days ago: a reminder that you place in top of a medicine tube to remember the last time you took your medicine. This design was published on Thingiverse.

pillReminder_assembled pillReminder_dissasembly

To get a practical design I had to go through multiples iterations and the 3D printer was a great way to directly have a confirmation that my changes were going in the right direction. In this case I just had to wait 50 minutes to see the alterations results…

PillReminderEvolution

So what are the consequences of these short prototype cycles? Can these 3D printer be used by the end customer to get exactly the right custom product?

When we think about the “2D” version of printing we can see and evolution with:

  1. Scribes and monks reproducing parchment by hand
  2. Gutenberg and the print press with mass production of books
  3. To reach mass customization with modern printer technologies like inkjet or laser

2D_evolution
Images sources: [1] [2] [3]

Now if we look at the 3D object reproduction, we can see that the first step was sculpting to get a custom object. Then injection molding and casting helped to mass produce the same shape and now the 3D printers are opening the realm of mass customization…

3D_evolutionImage Sources: [1] [2] [3]

Note that I’m not trying the start a flame war when I make a parallel between hand-writing and CNC. Modern machining is in a sense the final step of evolution of sculpting. The helmet picture is one of the most impressive demonstration of 5 axis machining that I’ve seen so far. Built by Daishin, the speed and the details that this machine is capable of carving are absolutely stunning.

Now 3D printing is currently at his infancy slow and some time limited. But it as already access to many materials from plastics to metal and ceramic. New fields are opening with organ and organic tissues printing. So who can really know where it will stop?

[<<Prev. – First Prints]    [3D Printer articles]   [3D printing Ecosystem – Next>>]

Impossible Dovetail Joint

For this week Impossible object, we will revisit the dovetail joints and have a look at some interesting variation on the theme. This time we will use the “master sketch” technique in Inventor to build our different pieces.

 

This technique is using a single part with all the sketches required to model the whole assembly. Each piece is then derived from the master. To update the model, you just have to update the master sketch, and if everything is properly built, your whole assembly should follow.

Result_picture1

The inventor result files links are at the end, with the STL and the thingiverse link.

  • To start, create a part with a bunch of user parameters to control the design. Then on the horizontal plan XY create a sketch with the outline of the 2 main blocks (length*width).
    impossibleDovetail_01_userParam
  • The dovetails are extruded on a non-vertical plan, so the easiest way to control the result is to create a sketch in XZ plan and draw a segment with ‘Tilt’ angle from the horizontal. Then use this segment and the origin point to create the work plane using “Normal to axis through Point” tool.
    impossibleDovetail_02_TiltPlan
  • The next sketch will be on this newly created plan. The left triangle and the left side of the center one are drawn and the rest is a mirror copy. The base of the left triangle is at length/5=10mm. To allow some clearance in the pieces, all triangle have been “offset” inside by “clearance” parameter (0.25mm here).
    impossibleDovetail_03_DovetailSketch
  • The final master sketch part should now look like the view under.
    impossibleDovetail_04_Mastersketch
  • Now we create a new part to model the first piece. From the manage tab, select the “Derive” tool and choose the master sketch part. Then make sure that the User parameters and the Sketches are shared (yellow plus) and validate. The master sketches will appear in you new part. Now any change in the master sketch will update the part (you will have to press the update button / thunder bolt)
    impossibleDovetail_05_Derive
  • Each sketch will be used multiple time to build the piece, so don;t forget to make them “visible” again once they have been used by an operation. The first thing will be to create the “male” dovetail in the center, so the first step is to extrude the small version of the center triangle by a very large amount on both side.
    impossibleDovetail_06_Centerdovetail
    Then extrude the left rectangle by height and keep only the intersection. to create the dove tail.
    impossibleDovetail_07_CenterdovetailFinished
    impossibleDovetail_08_CenterdovetailFinished2
  • Now the main body can be created by Extruding the right rectangle by “height”.
    impossibleDovetail_09_body
    To create the 2 side female dovetails, just select both the external rim and the internal triangle on both side and cut into the main piece.
    impossibleDovetail_10_body
  • To finish the piece you can add a fillet on the internal side of the dovetail.
    impossibleDovetail_11_finish
  • The second piece is created the same way, from a derived part except you have to do the “negative” geometry.
    impossibleDovetail_12_PieceB

And here is the result assembled with a “wood” finish 🙂

impossibleDovetail_Result01

impossibleDovetail_Result02

I’ve printed the result to check that the piece would indeed fit and yes it works!

The STL files are available in Thingiverse here and the Inventor files are here.

[<<Prev. – Symmetric Penrose Triangle]    [3D Printer articles]   [TBD – Next>>]

3D printing: your friend the Slicer

Modeling your shape is only the first step of 3D printing. You need to process the resulting mesh with a slicer program that will cut your solid into thin slice and decide how to print them. The output of a slicer program is a G-code file that contain the instructions to move the printer and extrude the filament. They are multiple slicers programs available but I will only mention three that were evaluated by Reprap magazine (in no particular order):

  • Cura and Slic3r are very effective open source packages
  • KISSlicer is a commercial product, but the free version let you print single object with most of the options available.

As you can discover in the Reprap magazine, there is no one solution to the slicing problem. It’s an optimization task and each program is solving the paths differently. Each of these package offers different options to reduce problems like strings / seams on the edges and increase overall printing quality.

slicerJob

In the previous picture you can see how KISSlicer is splitting this “gear”. The path colors on the right represent the type of extrusion the printer will do. Like you want to have a lower speed and more precision for the output shell, but for the inner shells, the printer can go faster.

As I was looking at the subject I found these vase pictures from 3DPrinterGear user on KISSlicer forum where you can see that depending on the printing mode, you can end-up with a very visible seam on one side, or more like a “chicken-pox” effect  when the slicer starts each profile at a different point each time.

seamOnVase

The ‘obvious’ solution was to extrude the plastic in one path, think of it as a spiral and avoid completely the issue. I found later that Cura slicer has an option called “Joris mode” to exactly do that for single wall objects. That seems like an interesting challenge to take and see how hard it would be to build a slicer and generate some G-code to print a continuous extrusion profile. As this is only considering the outer shell profiles it’s a nice subset to experiment and develop algorithm for. So let’s dig in the slicer, algorithm!

Note: all the graph on this post are generated using Matlab. The code is available at the end of the post. The gear shape is coming from this thing on Thingiverse made by Emmett.

Slicer Step 1: Find Intersecting triangles

The first step once the tessellation is read is to find for each Z plan the section of the geometry.

gearSlice

The geometry of a STL file is a tessellation of triangles in space. So the brute force method to do it is to test if each triangle is intersecting the current plan. This is obviously not optimal and we have to weed out most of the candidates otherwise we’ll spend ages processing the file.

Let’s simplify the problem and display it in 2 dimensions (only X and Z), now for each triangle we can find the lower Z vertex and the higher Z vertex. Example in triangle A the lower is at Z=2 and the higher Z=13. Then we have to sort all the minimum and the maximum in 2 lists of increasing Z values.2dSlice

Now we can have a tool to figure out which triangles are in any Z plans in 2 steps by doing:

</code>
for currentZ = 0:N
    1/ Add any triangle from the bottom list
       with bottomZ value smaller or equal than currentZ
    2/ Remove any triangle from the top list
       with topZ value smaller than currentZ
<code> 

So for example if the plan you want to test is Z = 8.5 you will have:

  1. Add in list triangles : [C A D B]
  2. Remove from list triangle C

=> the answer is only triangle [A D B] have to be tested for the section.

For a real implementation you would keep the list from one Z plane to the next and the location in the list were your stopped the search because triangle that are already under will never be used again. Also to keep the R/W low it’s probably more efficient to use a linked list in C.

Slicer Step 2 : projection of Intersecting triangle on current plan

For each of the intersecting triangle we have to check how many vertex are already in the plan as no extra computation are required in this case.

vertexInPlan

For every remaining segment of the triangle with vertex on both side, the “segment to plan” intersection is easy to compute:

segmentProjection

And here are example of the result for the gear section. The left picture is the bottom plan of the object so all the faces are in the plan and displayed as triangles of various colors. The right picture is a plane over were all the intersecting faces are represented as segment.

sliceResult

That’s all for today, the graph are generated using this Matlab package, and all code are copyrighted, only usable for non-commercial purpose and provided as is with no guaranty of any sort! The package includes a Matlab STL reader that can open TXT and binary files.

[<<Prev. – STL Matlab Writer]    [3D Printer articles]   [TBD – Next>>]