Welcome! Log In Create A New Profile

Advanced

Importing cross sections

Posted by Javaid Butt 
Importing cross sections
November 25, 2013 10:30AM
Hi,

I want to print something and for that purpose I will send the CAD file to the 3D printer, the software will slice up the part and I could see the layers.

I want to import the cross sections/slices that are created when a part is processed. Is there any software that will help me import the layers so that I could use that data for other purposes.

Thanks in advance for the help.
Re: Importing cross sections
November 25, 2013 09:41PM
What are your requirements for import? The G code itself is already in layers and each layer describes the x, y, an z coordinates each step of the tool paths. What else do you want?
Re: Importing cross sections
November 26, 2013 01:43AM
Yes, you are absolutely right my friend, the G-code is there for each layer (I could go on with the G-codes and recreate each layer as I go along but the software idea seems more direct).

I want to import the CAD model of the layer in stl or any other format that would open the layer in a CAD software. For example, I want the bottom layer of the CAD drawing and I want only one layer as a CAD model that I could open in a CAD software. Then another and another, each as one single CAD file (I know there will be dozens of files that way but I need each of the layers separately).

All the ones that I have tried after slicing the CAD model converts it into a format that only the 3D printer could access so I am a bit stuck here. I hope you understood what I am trying to do here.

Thanks.
Re: Importing cross sections
November 26, 2013 11:42AM
I understand what you're trying to do. The problem as I see it is that the only place that has the data organized as layers is the g code. You'd need to isolate each layer and then convert back to STL. I'm not even sure that's possible from a mathematics point of view, and I don't know of any software that would do this.

If you think about, it' s a difficult problem. The perimeters would be easy enough, but how to interpret the infill? Remember - the STL file that started everything only describes the shell, not the interior. So based on that, should sparse infill be ignored? How do I determine whether or not infill is sparse - it could be one of many different patterns. A lot of inferences would have to be.
Re: Importing cross sections
November 26, 2013 11:53AM
Lots of programs will allow you to export a cross section of the model. I use Blender which is a mesh modeller and you could easily do this by intersecting a flat panel with the model where you wanted the cross section. Blender also has a cross section tool that will give you a 2d outline of the cross section. You could also use the intersection method in programs like openscad. For actual CAD software I believe most have cross section or cut-away tools that should be able to do the job.


FFF Settings Calculator Gcode post processors Geometric Object Deposition Tool Blog
Tantillus.org Mini Printable Lathe How NOT to install a Pololu driver
Re: Importing cross sections
November 27, 2013 05:02PM
@ Sublime

So I basically wasted an entire day trying with Inventor to get the job done but no luck.

I have installed Blender now and would greatly appreciate of you could walk me through the steps. I have attached the file that I want to slice but knowing how to do it, is more important to me than to get it done.
Attachments:
open | download - ask_351_010.stl (19 KB)
Re: Importing cross sections
November 27, 2013 10:41PM
No worries. I will try and walk you through it, let me know if it works.

1) Press x and delete the default object that Blender starts with (you may need to select it first which is by default right click (can be changed in the preferences to left click)). Also note that by default the cursor position in Blender is set by left clicking and we want it in the center with your STL. If you move the cursor press "shift s" and select cursor to center or object.

2) Now with a blank scene you will want to import the STL.

3) The STL should now be imported into the current scene and have a dark orange glow around it because it is selected but not as the active object.

4) Press "shift a" and select mesh / cube to add a cube to the scene.

5) Now you will have added a small cube in the scene right where the cursor is and it will be outlined with bright orange indicating that it is the current active item.

4) Now press n which will bring up a menu in the main window (or remove it if it was already up) but we want it visible.

5) Now with the small cube still the active object go into the new menu from the last step and find transform / dimension.

6) In dimension set the X and Y sizes to three times the size of your object to ensure it will intersect all of it even if it is not centered.

7) In dimension set the Z size to the thickness you want your slice.

8) At this point you should have a large flat panel intersecting your part.

9) Now select the STL part (remember the strange right click select by default).

10) With only the STL selected press h to hide it (if you want all hidden objects back press "alt h" to unhide them)

11) Now the only part in the scene will be the flat cube we made in steps 5-7.

12) Select the flattened cube (remember the strange right click select by default).

13) Now over on the right you will see a panel with little icons along the top of it. The first icon is a camera then a stack of papers, geometric objects, a planet, a cube, a chain and then a wrench. Select the wrench it is the modifier panel.

14) In the modifier panel select boolean from the drop down menu.

15) Now you will have a boolean modifier which defaults to intersect which is what we want.

16) Now in the boolean modifier you will see and object field. Select the object you want to slice in the object field.

Now you should have a cross section of the part.

You can move the cross section up and down by pressing g (which stands for grab) and then z to lock it along the z axis. After pressing g and z you will be able to move the slice up and down in real time with your mouse. You can also enter a number after pressing g and z which will move the slice by that amount along the Z axis in mm (press - if you want it to move down not up).

You can now select export STL from the file menu to export the cross section (no need to press the apply button in the boolean modifier as it exports the part with all modifiers applied automatically).

A few tips you may need. When ever I said to press a key you will most likely need to have the mouse over the main window with the part in it or it will not do anything. You may need to enable the STL import and export plugin in the preferences.

I have also attached a Blend file with your STL and a 2mm thick plane already intersecting the STL producing a cross section.


FFF Settings Calculator Gcode post processors Geometric Object Deposition Tool Blog
Tantillus.org Mini Printable Lathe How NOT to install a Pololu driver
Attachments:
open | download - ask_351_010.blend (554.9 KB)
Re: Importing cross sections
November 29, 2013 02:53AM
Bear in mind that the slices you create using blender will in no way correspond to the slices your slicer will generate foir 3d printing unless you manually calculate the z position for each one. These are slices created from the original stl file, not from the g code - which is how I interpreted the original post.
Re: Importing cross sections
December 11, 2013 07:37AM
See Special variables - $t in the OpenSCAD User Manual.

As an example with a slice height of 0.4mm:
slice = 0.4;
radius = 30;
factor = radius*2/slice;

module object(rad) {
	translate([0,0,rad])
		sphere(r=rad);
}

module Slice(num) {
	intersection() {
		object(radius);
		translate([0,0,factor*num*slice+slice/2])
			cube([200,200,slice], true);
	}
}

Slice($t);

Animate with FPS = 4 and Steps = 150.

It should be possible to use the OpenSCAD command line to export the STL file for each slice.
See the Using OpenSCAD in a command line environment section in the OpenSCAD User Manual.

This could be done by creating a BATCH FILE that passes the $t per the command line to create each slice.

See the SliceItNow.* files for an example of how this can be done.


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Attachments:
open | download - SliceIt.scad (282 bytes)
open | download - SliceItNow.awk (216 bytes)
open | download - SliceItNow.bat (14.1 KB)
open | download - SliceItNow.scad (288 bytes)
Sorry, only registered users may post in this forum.

Click here to login