How to create a rectangular pattern with over 1700 quantity?

How to create a rectangular pattern with over 1700 quantity?

Anonymous
Not applicable
1,563 Views
28 Replies
Message 1 of 29

How to create a rectangular pattern with over 1700 quantity?

Anonymous
Not applicable

Hi there,

 

I know I have gain a lot of help for my project on here, but I am relatively new to Fusion360 and 3D modeling and I am learning all of this by the online tutoring. So, if anyone could give me any hints, that would be great!

 

I am trying to create a rectangular slab consisting of a hexagonal closed packed spheres. The rectangular slab should be 70mm * 20mm * 1mm and the diameter of each sphere should be 40 microns. Therefore, by division, I would need 1750 spheres in length, 500 in width and 25 in height.

 

Of course, when I type in 1750 into the quantity of the R-pattern dialog box, the software stop responding because it is eating up too much resourses. I tried breaking it up to 100, 200, 300 ... (add 100 at a time) and create a new component to store the R-pattern, but it still eats up too much resources. 

 

This is a video of my approach: https://screencast.autodesk.com/main/details/fca75f4b-8db0-411f-afe2-dbd838e5c409

 

I wonder if there is any way to approach this problem?

 

I truly appreciate any of your help!!!

 

Jason

0 Likes
1,564 Views
28 Replies
Replies (28)
Message 2 of 29

Anonymous
Not applicable

Just a side note, this model is to be 3D printed!

0 Likes
Message 3 of 29

jeff_strater
Community Manager
Community Manager

Thanks for posting.  Interesting problem.

 

That is a lot of instances.  If my math is not failing me, the total would be almost 22 million.  I'm not surprised that Fusion has a bit of a problem with that much geometry.

 

So, I'm not sure that you will ever really get reasonable performance for this model.

 

That said, there are some techniques that can help a bit.  I understand what you are trying to do by combining as you go.  It seems quite reasonable.  However, in a way, this is actually counter-productive.  You want to make sure that you are patterning components (by selecting the component from the browser).  Once you are patterning components, you might actually get better performance if you left your sphere as one component, then pattern the component.  The way components work, the geometry is actually shared among all instances.  So, it should be more efficient.  I would create a large array as a component pattern, then do one single combine at the end.

 

However, I am afraid that even this technique will not let you get to 1750 x 500 x 25.  I tried just 100 x 20 even that performance was not what I had hoped.  It took quite a few minutes to update.

 

Jeff Strater (Fusion development)

 

 

 

 

 

 

 

 


Jeff Strater
Engineering Director
Message 4 of 29

Anonymous
Not applicable

Hi Jason, what I would do is generate the gcode for a single sphere object, then create a program that would take that gcode and process it to "duplicate" it for each desired offset xy origin position, creating a new gcode text file (that would be quite long but I would think should work).  Let me know if you need help with this.

Jesse

0 Likes
Message 5 of 29

Anonymous
Not applicable

Hi Jesse,

 

Thank you for your reply! I do not have any knowledge about gcode, I would have to learn it before I could write one.. Right now i am communicating with my lab to see if we could print it out by "chunks" and somehow "stick" them together. But if that doesn't work, it seems that I would have to learn gcode............... btw I know some java, matlab and autolisp

 

Jason

0 Likes
Message 6 of 29

Anonymous
Not applicable

That's cool that it sounds like you have a lot of persistence!  Fortunately it shouldn't really take much for this.  I first looked up the Gcode G54, which is for work/fixture offsets, but it looks like that is not a universally accepted code.  So really all you would need to do is make a program that would process many times the gcode for one sphere.  Each time, it would go through it, and where ever there is a " X" (note the space in front) it would add a certain value (a multiple of the sphere diameter) to the number immediately following the " X".  It would do the same thing for each " Y" instance, doing that however many million times 😉  So you really don't have to learn any gcode to make such a program.  Let me know if you would need me to do this (in my spare time 😉 ). 

 

It seems like a very interesting project you are working on!

Jesse

0 Likes
Message 7 of 29

Anonymous
Not applicable

Thank you for your reply and offer! That is very kind of you!

As I said before, I do not have any knowledge in gcode. So...I didn't really understand what you were saying.. how could I write such program without knowing any gcode?

 

Jason

0 Likes
Message 8 of 29

Anonymous
Not applicable

Try this: in Fusion 360 when you have a simple model, go to the 3d print option under File, and you can choose an application to send it to or just save as an stl.  Use the slicer of your choice (I use Slic3r, which runs in the free Repetier program) to generate the gcode.  In windows explorer, I change the .gcode extension to .txt, so I can view it with a text editor, and also access it with the programming language of your choice.  You will notice in the text file there's not actually that much going on:  Here's an example (additional commands that may appear and that you're curious about can be looked up here http://reprap.org/wiki/G-code):

 

G21 ; set units to millimeters
G90 ; use absolute coordinates
G92 E0 ; define current Extruder position as being at zero (can do the same for axises, via G92 x0 y0 z0)
M82 ; use absolute distances for extrusion
G1 F1800.000 E-1.00000 ; these G1 commands are what you are interested in (actually you your program will just search for " X" and " Y" to make modifications), they command a move, so this one means to back the extruder motor up 1 mm from it's present zero position, at feed rate of 1800 mm/minute


G92 E0 ; again extruder set to present position being defined as zero.
G1 Z0.464 F7200.000 ; now this says for the z axis to go to this particular height (this code assumes the x,y,z axises have already been homed (i.e. their present positions have been defined by a G92, so machine knows where .464 for z actually is relative to that)


G1 X52.405 Y52.249 F7200.000 ; so for each new sphere that is to be printed, it's these X and Y values that need to be offset repeatedly by your to be written program
G1 E1.00000 F1800.000
G1 X54.158 Y50.767 E1.21474 F1440.000
G1 X56.311 Y49.972 E1.42949
G1 X57.500 Y49.864 E1.54119

 

and so on. 

 

As you can see, it's really just a matter of writing a program that could repeatedly modify those x and y values and combine everything into one text file.  I'm not sure what kind of 3d printer you will be using, but hopefully a powder bed printer or what not should not be any different for your intentions.

 

Let me know if you try to pursue this and have any questions!

Jesse

0 Likes
Message 9 of 29

Anonymous
Not applicable

Thank you SO MUCH for this detailed explanation!! 

However...hmmm where can I select the slicer again..? 

 

Jason

0 Likes
Message 10 of 29

Anonymous
Not applicable

The way I got it was to download the Repetier Host, which will have Slic3r bundled in it automatically.  You import an stl into that (or launch from Fusion 360 3d print) hit the slice button (can modify slicer configuratoin first), and in preview tab can see the gcode and save it there.

Let me know when you run into trouble 😉

Jesse

0 Likes
Message 11 of 29

Anonymous
Not applicable

I haven't tried it much yet, but when you go to 3d print in Fusion 360, there is the option to get Print Studio by Autodesk for free, which is another option, especially if your print needs a lot of supports (although this print looks pretty straightforward).

Jesse

0 Likes
Message 12 of 29

Anonymous
Not applicable

Oh I see! I just pulled out the G-code into the notepad and I can understand what you meant by I dont need any G-code experience to do this.

This is part of my G-code:

 

M82 ; use absolute distances for extrusion
G1 F1800.000 E-1.00000
G92 E0
G1 Z0.500 F7800.000
G1 X90.113 Y89.794 F7800.000
G1 E1.00000 F1800.000
G1 X90.883 Y89.102 E1.06540 F600.000
G1 X91.497 Y88.617 E1.11475
G1 X92.348 Y88.027 E1.18014
G1 X92.934 Y87.673 E1.22340
G1 X93.938 Y87.149 E1.29489
G1 X94.890 Y86.742 E1.36029
G1 X95.627 Y86.481 E1.40964
G1 X96.036 Y86.358 E1.43663
G1 X96.623 Y86.198 E1.47504
G1 X97.638 Y85.992 E1.54043
G1 X98.411 Y85.880 E1.58978
G1 X99.029 Y85.825 E1.62898
G1 X100.226 Y85.793 E1.70453
G1 X100.717 Y85.811 E1.73559
G1 X101.260 Y85.847 E1.76994 F600.000
G1 X102.036 Y85.938 E1.81929
G1 X103.055 Y86.123 E1.88469

 

My understanding is that the X and Y before F is the "origin position" for the sphere and the only thing I need to do is to offset the "origin position". However, as you could see from the Gcode, there are more than one X Y followed by F.. so which one should I modify? Should I modify all of them?

 

Thank you again for your help. You are very kind and helpful!!!!!!!!!!!!!

 

Jason

0 Likes
Message 13 of 29

Anonymous
Not applicable

Nice to see you're generating some gcode!  So you'll see every once in awhile a G1 line that sets the Z height value.  Once that is done (the first height is 0.5 mm) then you'll see a bunch of X and Y values (each with an E value).  So the way G1 works is to make a straight line from previous position to new position, at the last feed rate that was declared.  So say in below example, a previous line had an F200 value. Then these lines follow

 

G1 X3 Y5 E2

G1 X3.5 Y6 E2.1

 

Here the extruder will move in a straight line a distance of Sqrt((3.5-3)^2+(6-5)^2), at a rate of 200 mm per minute.  (and during that line travel, there will be 0.1 mm of filament constantly extruded).  So you can imagine, you need to have a lot of very short straight line segments to decently approximate a curve (there are gcode commands for arcs, but not apparently not normally used for 3d printing).  So all of these straight line moves in xy plane occur at a fixed z height that was first established.  Then once that layer is all printed, a new z height will be declared. 

 

But all you care about is getting the exact same object to print at some other offset position, so this should be accomplished if every x and y value in the gcode for one sphere has appropriate constants, say Xoffset and Yoffset, added to them.

 

Should be interesting if we can pull it off! 

Jesse

Message 14 of 29

Anonymous
Not applicable

Hi Jesse,

 

I have attached the original G-code and the modified G-code here. Note that I'm only using a single for loop with i less than a thousand because that would be easier to process. Once we make this happen, I could just change the i value and print the hell out of it!! Thank you again for your help! 

 

Thanks,

Jason

Message 15 of 29

Anonymous
Not applicable

Also, since currently I only have access to Flashforge creator pro which used makerbot and only takes in x3g or stl files, I used replicatorG to try to convert my g-code to x3g but replicatorG complained about two M-code (M82 and M84). I searched for the replicatorG M-code list online and changed M84 to M18 and deleted M82 (since I can't find a substitute for M82). What happened was the extruder didn't seem to know where to start and just pushed PLA straight at the original position.

 

I might have access to different 3D printer next week, so I might be able to print directly using my g-code but I'm not sure about that!

 

Somebody suggested me to use the convertor called gpx, I'm gonna try that and see how it goes.

0 Likes
Message 16 of 29

Anonymous
Not applicable

Hi Jason, really cool to see you working on this!  I just looked at the modified gcode, and it looks like a new iteration starts on line 985, but the x and y values look the same as the previous iteration, as apposed to having an offset.  I'm not very familiar with java, but are you missing something to take an existing value and add an offset to it?

Jesse

0 Likes
Message 17 of 29

Anonymous
Not applicable

Hey Jesse! Thank you so much for paying attention to the details haha

 

It turns out I made a super stupid bug in my java program, I just fixed it and below are the attachments! THANK YOU SO MUCH  FOR YOUR HELP I HAVE TEARS IN MY EYES.

0 Likes
Message 18 of 29

Anonymous
Not applicable

Glad to help, not many people try to do unusual stuff like this, or actually work at following through with it!  Now the gcode looks good, from an initial inspection it looks like on each iteration the x is being offset by 40 and the y by 120, I'm guessing since the original gcode prints 3 spheres.  This way each cluster of 3 spheres are going to be printed at a diagonal location to the previous 3.  Of course if you want them to be printed in a straight fashion side by side, you would want to only offset either the x or the y each iteration, but not both at the same time.  Using two loops you could print the two dimensional array of spheres, by say the inner loop offsetting the x, and once those iterations are done, the outer loop would increment the y to a new value and the inner loop would begin again with the x offsetting, and so on. 

 

It will be interesting to see how this prints.  As I mentioned earlier, the "normal" approach would be to only offset the values for one layer, so that only the first layer of all the spheres are printed, then the next layer, and so on.  But that is of course more complex to try creating a gcode modification program for, so I would stick with the current method for now.

 

As to the M codes, it looks like the M82 is the only important one, and it's amazing it's not being recognized.  Hopefully you can get that straightened out.

 

Very cool stuff.

Jesse

Message 19 of 29

Anonymous
Not applicable

Oh right! I should change the for loop, that is really a not quite intelligent mistake haha

 

I don't really know how to solve the M82 issue, can I just ... delete it?

0 Likes
Message 20 of 29

Anonymous
Not applicable

Making lots of mistakes is always part of the process...never really changes 😉

 

So for this whole format thing, I've used slicer (accessible as standalone download, or I use it through Repetier), and you can see in below image, you can choose for G-code flavor Makerbot, and also there's a choice below that to use relative E-distances, which sounds like what may be needed, although I would probably just try the former first. 

 

10.jpg

 

Good luck!

Jesse

0 Likes