<p>Not directly. The most common types of 3D printers build objects in layers. They "draw" a layer, then "draw" another layer slightly above it, repeating until they've "drawn" the entire model. Preparing your model for this is called "slicing", since you are "slicing" your model into these layers. Slicing is a complex process and it's a lot of work to "roll your own" software for it, and there are several good, free applications to do it for you out there already.</p>

<p>What you probably <em>can</em> do easily is output your data in STL format to be read by the slicing software. STL (either ASCII or binary) is a dead simple format that contains the triangles that comprise your model. So simple, in fact, that the <a href="https://en.wikipedia.org/wiki/STL_(file_format)" rel="nofollow">Wikipedia article</a> tells you just about all you need to know.</p>

<p><strong>To get triangles from squares:</strong></p>

<pre><code>A--B    Here is a "square" with vertices ABCD.    A--B    A--B    A
|  |    Splitting it from A to C produces two     |\ | -&gt;  \ |    |\
|  |    triangles, ABC and CDA.  This can be      | \| -&gt;   \|    | \
D--C    done as part of the output by simply      D--C       C    D--C
        writing two triangles for every
        square in the input.
</code></pre>

CC BY-SA 3.0
2016-07-03T01:30:39.670Z
Thanks for answering but i don't think it will work my math is not written for triangles. its just striaght forward vector math that constructs squares in 2d and cubes in 3d, not triangles.
goo gle
CC BY-SA 3.0
2016-07-03T15:05:07.047Z
@google - It's really easy to split squares into triangles, though. Just pick a diagonal arbitrarily and divide each square into two triangles, like cutting a sandwich. You can do it as part of the output routine so the original model isn't modified. If your square is defined by vertices A, B, C, and D, going clockwise, then output triangles ABC and CDA.
John Sensebe
CC BY-SA 3.0
2016-07-03T23:49:43.030Z
i'm not useing a program with a graphical interface that you can use with a mouse, like cad or blender. I'm useing a version of qbasic called qb64 it's only texted based. There is nothing for me to split. there are no models to work with its all purely text. The 3d vector data projects a 3d image on the 2d screen as a finished picture not a model
goo gle
CC BY-SA 3.0
2016-07-04T12:37:31.293Z
@google I think John gets that. You'll need to do the splitting in your code, to convert the vectors and cubes into triangles as required by STL format. You could also look into using OpenSCAD, which is a programming language designed specifically to programatically generate STL files.
Tom van der Zanden
CC BY-SA 3.0
2016-07-01T20:07:58.853Z
2016-07-06T02:41:17.180Z
2016-07-06T02:41:17.180Z
John Sensebe
<p>I'm a newb and don't know much about 3D printers.
In visual basic I can create vector data of 3d objects,that can be loaded into a binary or text file.
Can files like this be used with a 3d printer?</p>

<h3>Example:</h3>

<p>This is a very simplified example of how the code generates 3d vector data.</p>

<pre><code>ju jv jw determine the size and dimensions of the object
ru, rv, rw are the vector lenghts
</code></pre>

<p>The incrementors used to increase the size of the object to the max ju jv jw vaules:</p>

<pre><code>ru=ru+1
rv=rv+1
rw=rw+1
</code></pre>

<p>'the angles can also be incremented to for curves and spirials'</p>

<p>the angles of the vectors</p>

<pre><code>angle u =0
angle v =45
angle w = 90
</code></pre>

<h3>Simplified code:</h3>

<pre><code>For k1 = 0 To Ju

    ru=ru+1

    xu = (ru * Sin(angle u))

    yu = (ru * Cos(angle u))


For k2 = 0 To Jv

   rv=rv+1

   xv = (rv * Sin(angle v))

   yv = (rv * Cos(angle v))



For k3 = 0 To Jw

    rw=rw+1

    xw = (rw * Sin(angle w))

    yw = (rw * Cos(angle w))


Output xu, yu, xv, yv, xw, yw  ..to file in the order produced on this line

Next k3 : next k2: next k1
</code></pre>

<p>Can a 3d printer read this output as is and use it to make a 3d object?</p>

CC BY-SA 3.0
2016-07-01T20:14:41.510Z
Hi, goo gle! You question is quite unspecific and therefore difficult to answer properly in its current state. Could you please give us a concrete example of what you are wondering about? For instance, what code do you have, what does the 3D models look like, what file format do they translate to, what do you want to achieve, and what have you tried so far? I have chosen to put your question on hold so that you can make your changes. Please let us know when you are ready to open it. Also, welcome to 3D Printing SE!
Tormod Haugene
CC BY-SA 3.0
2016-07-03T01:36:50.093Z
Someone else told me it would have to be in STL format and i don't think that will work with my data. Because its just striaght forward vector math that constructs squares in 2d and cubes in 3d, not triangles. But thank you for the reply.
goo gle
CC BY-SA 3.0
2016-07-03T02:28:05.603Z
i use the method of Graphical Addition of vectors. found on this web page    http://www.electronics-tutorials.ws/accircuits/complex-numbers.html scoll down to Graphical Addition and Subtraction
goo gle
CC BY-SA 3.0
2016-07-03T09:07:28.987Z
Could you please add your information to your question by using the *edit* button in gray text below your question? You will then be allowed to add pictures, code snippets etc. just as you would when writing the question for the first time. Also, when you are done, you can vote for your question to be reopened for answers by pressing the *reopen* button just right of the *edit* button. :-)
Tormod Haugene
CC BY-SA 3.0
2016-07-04T04:34:27.843Z
@goo gle the answer is NO - it won't work. It's much better to read about 3d printing/slicers/firmwares than presenting your code. It's strongly recommended to get at least basic knowledge because then we would have common area to discuss. You did ask the question and John Sensebe answered but you say you know better. Tell me how to convince you that there are principles which you have to accept rather than convince us that your way (of representing 3d objects) is ok. Converting 3d obj to printer format is a bit more than 15 lines of code. Please read at least passed wikipedia article.
darth pixel
CC BY-SA 3.0
2016-07-04T05:38:48.513Z
Your question is now open again. I made some further code formatting which you might want to have a look at.
Tormod Haugene
CC BY-SA 3.0
2016-07-04T13:48:46.603Z
thank you for your reply I'll look into this at a latter date.
goo gle
CC BY-SA 3.0
2016-07-06T03:35:50.607Z
@ darth pixel  "goo gle the answer is NO - it won't work" Thank you, you answered my question, thats all i need to know, have a nice day :)
goo gle
<3d-design><slicing><cad>
File Input data types
goo gle
# File Input data types

(Asked by: username_0 on 2016-07-01)

I'm a newb and don't know much about 3D printers.
In visual basic I can create vector data of 3d objects,that can be loaded into a binary or text file.
Can files like this be used with a 3d printer?

### Example:

This is a very simplified example of how the code generates 3d vector data.

```
ju jv jw determine the size and dimensions of the object
ru, rv, rw are the vector lenghts

```

The incrementors used to increase the size of the object to the max ju jv jw vaules:

```
ru=ru+1
rv=rv+1
rw=rw+1

```

'the angles can also be incremented to for curves and spirials'

the angles of the vectors

```
angle u =0
angle v =45
angle w = 90

```

### Simplified code:

```
For k1 = 0 To Ju

    ru=ru+1

    xu = (ru * Sin(angle u))

    yu = (ru * Cos(angle u))

For k2 = 0 To Jv

   rv=rv+1

   xv = (rv * Sin(angle v))

   yv = (rv * Cos(angle v))

For k3 = 0 To Jw

    rw=rw+1

    xw = (rw * Sin(angle w))

    yw = (rw * Cos(angle w))

Output xu, yu, xv, yv, xw, yw  ..to file in the order produced on this line

Next k3 : next k2: next k1

```

Can a 3d printer read this output as is and use it to make a 3d object?

**Tags:** 3d-design, slicing, cad

> **Comments:**
> **username_1**: Hi, username_0! You question is quite unspecific and therefore difficult to answer properly in its current state. Could you please give us a concrete example of what you are wondering about? For instance, what code do you have, what does the 3D models look like, what file format do they translate to, what do you want to achieve, and what have you tried so far? I have chosen to put your question on hold so that you can make your changes. Please let us know when you are ready to open it. Also, welcome to 3D Printing SE!  
> **username_0**: Someone else told me it would have to be in STL format and i don't think that will work with my data. Because its just striaght forward vector math that constructs squares in 2d and cubes in 3d, not triangles. But thank you for the reply.  
> **username_0**: i use the method of Graphical Addition of vectors. found on this web page    http://www.electronics-tutorials.ws/accircuits/complex-numbers.html scoll down to Graphical Addition and Subtraction  
> **username_1**: Could you please add your information to your question by using the *edit* button in gray text below your question? You will then be allowed to add pictures, code snippets etc. just as you would when writing the question for the first time. Also, when you are done, you can vote for your question to be reopened for answers by pressing the *reopen* button just right of the *edit* button. :-)  
> **username_2**: @username_0 the answer is NO - it won't work. It's much better to read about 3d printing/slicers/firmwares than presenting your code. It's strongly recommended to get at least basic knowledge because then we would have common area to discuss. You did ask the question and username_3 answered but you say you know better. Tell me how to convince you that there are principles which you have to accept rather than convince us that your way (of representing 3d objects) is ok. Converting 3d obj to printer format is a bit more than 15 lines of code. Please read at least passed wikipedia article.  
> **username_1**: Your question is now open again. I made some further code formatting which you might want to have a look at.  
> **username_0**: thank you for your reply I'll look into this at a latter date.  
> **username_0**: @ username_2 username_2  "username_0 the answer is NO - it won't work" Thank you, you answered my question, thats all i need to know, have a nice day :)  

---

## 1 answers

### Answer by username_3 on 2016-07-01. Score: 4

Not directly. The most common types of 3D printers build objects in layers. They "draw" a layer, then "draw" another layer slightly above it, repeating until they've "drawn" the entire model. Preparing your model for this is called "slicing", since you are "slicing" your model into these layers. Slicing is a complex process and it's a lot of work to "roll your own" software for it, and there are several good, free applications to do it for you out there already.

What you probably *can* do easily is output your data in STL format to be read by the slicing software. STL (either ASCII or binary) is a dead simple format that contains the triangles that comprise your model. So simple, in fact, that the [Wikipedia article](https://en.wikipedia.org/wiki/STL_(file_format)) tells you just about all you need to know.

**To get triangles from squares:**

```
A--B    Here is a "square" with vertices ABCD.    A--B    A--B    A
|  |    Splitting it from A to C produces two     |\ | ->  \ |    |\
|  |    triangles, ABC and CDA.  This can be      | \| ->   \|    | \
D--C    done as part of the output by simply      D--C       C    D--C
        writing two triangles for every
        square in the input.

```

> **Comments:**
> **username_0**: Thanks for answering but i don't think it will work my math is not written for triangles. its just striaght forward vector math that constructs squares in 2d and cubes in 3d, not triangles.  
> **username_3**: @username_0 - It's really easy to split squares into triangles, though. Just pick a diagonal arbitrarily and divide each square into two triangles, like cutting a sandwich. You can do it as part of the output routine so the original model isn't modified. If your square is defined by vertices A, B, C, and D, going clockwise, then output triangles ABC and CDA.  
> **username_0**: i'm not useing a program with a graphical interface that you can use with a mouse, like cad or blender. I'm useing a version of qbasic called qb64 it's only texted based. There is nothing for me to split. there are no models to work with its all purely text. The 3d vector data projects a 3d image on the 2d screen as a finished picture not a model  
> **username_4**: @username_0 I think username_3 gets that. You'll need to do the splitting in your code, to convert the vectors and cubes into triangles as required by STL format. You could also look into using OpenSCAD, which is a programming language designed specifically to programatically generate STL files.  

---

