LDraw.org Discussion Forums
Minifigs Patterns - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Minifigs Patterns (/thread-593.html)

Pages: 1 2


Minifigs Patterns - Stan Isachenko - 2011-08-22

Hello. I'm trying to create minifig patterns. I can draw them in Adobe Illustrator. And have some questions.
1) Where I can get proportions of the minifig body?(I pick them from picture in hollywood tutorial, but not very exactly)
2) Is here people, who interested in it?
I don't have enough time to clean them to Ldraw library standarts, but as pattern for later work can. Thank.


Re: Minifigs Patterns - Tim Gould - 2011-08-22

http://www.flickr.com/photos/jasbrick/5342583416/

That link has a minifig with all measurements in place. However, there are actually two sets of measurements floating around for minifigs which differ slightly. At the LDraw level of accuracy they are probably the same.

Tim


Re: Minifigs Patterns - Damien Roux - 2011-08-22

Sorry to be a bit out of the subject, but I'm also working with Illustrator to pattern parts (at least one: 2552).

I wasn't able to find an efficient way to export it to a Ldraw file while keeping the colors. Do you have any idea on how to do this, this would save so much time for huge patterns?

What I'm doing is quite complicated:
- Save a DXF with Illustrator
- Import it as a sketch in Catia V5
- Mesh it manually
- Divide the mesh to get one mesh by color (this is the longest part of the process: to do this manually, but this is the only way I found to seperate the meshes and to keep the vertex on the right position, so that if I reassemble the meshes again, the vertex match).
- Export each mesh as a STL
- Convert to Ldraw with STL2DAT
- Put each DAT file in a big one, so that I have all colors in the same part, with all triangles that are matching, avoiding gaps.
- Project and slice using SlicerPro

If one of you has any idea to get faster from Illustrator to Ldraw, feel free to help, I will appreciate.


BTW, I'm alost done with the 2552 file (don't remember which particular pattern number), so I will post it soon on the tracker...


Re: Minifigs Patterns - Travis Cobbs - 2011-08-23

Send me an Illustrator file, along with SVG and PNG versions of the same file, and I'll see if I can come up with something. (The PNG will just be for reference, so that I know that what I output matches the input.) If I can make out the input data, writing a program to convert it an LDraw file should be fairly easy.

If you don't have my email address, send it to the LDView email address.


Re: Minifigs Patterns - Chris Dee - 2011-08-23

This is the area that needs to be filled to fit an LDraw Minifig Torso :

2 4 -12 0 -10 12 0 -10
2 4 12 0 -10 14.345 2 -10
2 4 14.345 2 -10 19 29 -10
2 4 19 29 -10 19 32 -10
2 4 -19 32 -10 19 32 -10
2 4 -12 0 -10 -14.345 2 -10
2 4 -14.345 2 -10 -19 29 -10
2 4 -19 29 -10 -19 32 -10


Re: Minifigs Patterns - Stan Isachenko - 2011-08-23

thank you. This information help me.


Re: Minifigs Patterns - Stan Isachenko - 2011-08-23

Today i create image of Darth Vader Death Star. If you want you can download Illustrator svg file(in archive) hope it will help somebody to create part.
[Image: a991f736.png]


Re: Minifigs Patterns - Stan Isachenko - 2011-08-24

[Image: 545f76e2.png]

Image of Royal Guard Torso. Illustartor file.


Re: Minifigs Patterns - Travis Cobbs - 2011-08-24

Thanks. I'm investigating now. Don't expect an immediate result, since parsing an SVG file isn't exactly easy. (Plus, the XML parser I'm using doesn't like one entry in the file, and I had to manually remove that. Hopefully the parser will get a fix for that, though.)


Re: Minifigs Patterns - Stan Isachenko - 2011-08-24

Ok. I'm understand that it's hard work. I made those image to improve my skills in Illustrator.(I begin to work with it only 2 weeks ago). So it helps me, but i want to make something useful. So I will post here my works)


Re: Minifigs Patterns - Stan Isachenko - 2011-08-24

[Image: ca06354e.png]
Princess Leia torso. And Illustrator file.


Re: Minifigs Patterns - Jude Parrill - 2011-08-24

Hey Stan,

I'm glad to see SOMEBODY working on Star Wars minifig patterns, which are woefully behind patterns from other themes. I'd thought of doing some myself in the past, but had no idea how to get started. So far, all your patterns look really nice, and I hope that translates into some really nice LDRAW parts. Keep up the good work!


Re: Minifigs Patterns - Stan Isachenko - 2011-08-24

Thank you. I hope official Ldraw forum(I wonder why it opened only now:S) helps to coordinate people who can make parts. I think here are a lot of, who wants to see in Ldraw library SW minifigs.


Re: Minifigs Patterns - Tim Gould - 2011-08-25

I'm really looking forward to an SVG->LDraw converter (whenever it appears, no rush). It'll make sticker generation so much easier.

Tim


Re: Minifigs Patterns - Damien Roux - 2011-08-25

I must say: me also !

Correct me if I wrong, but problem is that SVG is using complex curves, not only lines and vertexes. So maybe, a good idea would be to search for (or write) a kind of tesselation program, that can output a triangular colored mesh from a SVG or whatever vectorized picture format. Then, to convert this mesh to Ldraw should be quite easy.

I've did some investigations with no success, but I'm 100% sure this king of program should exist somewhere.


Re: Minifigs Patterns - Travis Cobbs - 2011-08-25

Parsing the SVG file to create a list of polygons is the only part I'm unsure of. I know how to do everything else. It looks like it should be marginally do-able in a reasonable time-frame based on the Illustrator-generated SVG files I've seen, which seem to use a subset of SVG. I'm still investigating right now, though (although my investigation is through writing code).


Re: Minifigs Patterns - Tim Gould - 2011-08-25

Gotcha. I thought about doing it myself a while back but learning how to do the meshing was beyond the time I could dedicate to it. You've obviously got all that working already.

Maybe look at Inkscape generated SVG files too. Since it's free and open source it'll be a good second test.

Tim


Re: Minifigs Patterns - Stan Isachenko - 2011-08-25

[Image: 08f4bd9e.png][Image: 0355c7ad.png]
Master Yoda has 2 images so SVG files of front and back .


Re: Minifigs Patterns - Damien Roux - 2011-08-27

Travis,

I've found that it is possible within Illustrator to approximate those smooth curves with edges. Sounds perfectly like what Ldraw needs. I will give a try on one of those SW torso, and post the result here. With some luck, there might be only triangles into the SVG file... It should make things much more easier.

What do you think?


Re: Minifigs Patterns - Travis Cobbs - 2011-08-27

That could be a great help. I highly doubt the resulting file will be all triangles, but getting rid of the Bézier curves would certainly help. And if it switches the files from "paths" to polygons, it would help a huge amount, since parsing the paths is a royal pain. (Paths are an arbitrarily long list of commands, such as "moveto", "lineto", "bezier curve to", "close path", etc. all joined together.) Closed paths make filled shapes. Unclosed paths can make edges. They seem to be the hardest thing to handle in the SVG file, but in the Darth Vader torso file, they make up most of the geometry (certainly over half). And they have truly evil formatting. For example, all of the following are ways to represent a single 2D coordinate at (10, -10):

10,-10
10-10
10 -10

(That's right, a negative number doesn't require any separator from the previous number other than the minus sign. Is that evil, or what?)


Re: Minifigs Patterns - Damien Roux - 2011-08-27

Here are two different symplified svg of the royal guard torso.
SVG

One is using path only, the other is using mainly polygons (there still a path that I don't know how to get rid of)...

converting polygons should be much easier than the splines.


Re: Minifigs Patterns - Tore Eriksson - 2011-08-27

Damien Roux Wrote:
-------------------------------------------------------
> Here are two different symplified svg of the royal
> guard torso.
> SVG
>
> One is using path only, the other is using mainly
> polygons (there still a path that I don't know how
> to get rid of)...
>
> converting polygons should be much easier than the
> splines.

In deed it is easier. It was a piece of cake to extract the coordinates from "sw040 simplified 2.svg" into an .LDS file and compile those polygons into a .DAT file.
http://dl.dropbox.com/u/15954981/sw040.zip
And rescaling should be no challange at all. But from there, I'm afraid the polygons have to be entered by hand. :o

/Tore


Re: Minifigs Patterns - Tim Gould - 2011-08-28

Hi Travis,

I'm sure you've got it or are aware of it but I thought I'd remind you of Ross Crawford's Txt2Dat which can (IIRC) take a spline and convert it to a solid polygon.

http://www.br-eng.info/my-lego-roscomenu-29/my-ldraw-roscomenu-45/50-txt2dat

Tim


Re: Minifigs Patterns - Damien Roux - 2011-08-28

Isn't there an way to make a program create triangles using those points instead of lines only?

The difficulty would be to avoid overlapping triangles and make sure they are really "inside" the path... But I have no idea how to program that.


Re: Minifigs Patterns - Tore Eriksson - 2011-08-28

Damien Roux Wrote:
-------------------------------------------------------
> Isn't there an way to make a program create
> triangles using those points instead of lines
> only?

I'm afraid that would be extremely difficult to make.

> The difficulty would be to avoid overlapping
> triangles and make sure they are really "inside"
> the path... But I have no idea how to program
> that.

I do hope I'm wrong, but I think it takes a human mind to figure out how to make those polygones, what points to pick.

Once upon the 90's, I made a program I called LDD (LDraw Draw). I used it to make some patterned beams and I think most of the 3005 parts with alphabet and numbers patterns, too. The only reasonable way I can think of, would be to create a modern program based on that idea. But I don't think I'm able to write that complicated programs anymore.

/Tore


Re: Minifigs Patterns - Damien Roux - 2011-08-28

So then, I hope Travis has an idea (he said, getting polygones could greatly help him).

I was also think of creating the mesh directly in Illustrator, creating only polygones of 3 points (so triangles). But as I'm far away from being an Illustrator guru, I haven't find a way to do that yet.


Re: Minifigs Patterns - Tim Gould - 2011-08-28

--snip--

> I do hope I'm wrong, but I think it takes a human
> mind to figure out how to make those polygones,
> what points to pick.

If I understand what you mean luckily you are wrong Smile There's even standardised and free libraries these days to do it.

Once a polygonal outline is obtained it's relatively straightforward (not necessarily easy!) to mesh it. There's actually a whole lot of research into it as Finite Element Analysis is a profitable business.

> Once upon the 90's, I made a program I called LDD
> (LDraw Draw). I used it to make some patterned
> beams and I think most of the 3005 parts with
> alphabet and numbers patterns, too. The only
> reasonable way I can think of, would be to create
> a modern program based on that idea. But I don't
> think I'm able to write that complicated programs
> anymore.
>
> /Tore

Alas I can't really write these for fun anymore either. Only for work Sad

Tim


Re: Minifigs Patterns - Damien Roux - 2011-08-28

Well, I managed to get this quite easily, using Catia to mesh it and to split it into 2 meshes (1 per color).

But now I'm quite confused with scaling... I don't really know which scale has been used to create it first. Stan could you hepl me: how did you manage the unit when creating the pattern.

Dat File


Re: Minifigs Patterns - Stan Isachenko - 2011-08-28

I used this code
Code:
2 4 -12 0 -10 12 0 -10
2 4 12 0 -10 14.345 2 -10
2 4 14.345 2 -10 19 29 -10
2 4 19 29 -10 19 32 -10
2 4 -19 32 -10 19 32 -10
2 4 -12 0 -10 -14.345 2 -10
2 4 -14.345 2 -10 -19 29 -10
2 4 -19 29 -10 -19 32 -10
to create pattern for torso. Then scaled width to 450. Hight scaled automaticly. My workspace in Illustrator is 450 x 380 pixels. So no you can scale this pattern.


Re: Minifigs Patterns - Tore Eriksson - 2011-08-28

Damien Roux Wrote:
-------------------------------------------------------
> Well, I managed to get this quite easily, using
> Catia to mesh it and to split it into 2 meshes (1
> per color).
>
> But now I'm quite confused with scaling... I don't
> really know which scale has been used to create it
> first. Stan could you hepl me: how did you manage
> the unit when creating the pattern.
>
> Dat File

That was quite easily done as soon as I found the lower right coordinate:
{0,378.842,0} which corresponds to LDraw's {19,32,-10}
That gives:
1 19 19 0 -10 0.0844679 0 0 0 0.0844679 0 0 0 -1 Part2.dat
togeher wirh:
1 16 0 0 0 1 0 0 0 1 0 0 0 1 s\973s01.dat
(Did I mirror the pattern...?)

http://dl.dropbox.com/u/15954981/catia320.mpd


/Tore


Re: Minifigs Patterns - Stan Isachenko - 2011-08-28

Looks good. Only colors change left. Thank you.


Re: Minifigs Patterns - Damien Roux - 2011-08-28

Thanks for the tip Tore.

Stan: Maybe for futur pattern, it would be better not to scale the pattern and keep the Ldraw dimension as there are. If you really want to scan, doing it with x10 or x100 would be better. I had some manual corrections to do, because or decimal rounding errors after scaling.


Re: Minifigs Patterns - Damien Roux - 2011-08-28

I've posted the part on the tracker:
Link


Re: Minifigs Patterns - Stan Isachenko - 2011-08-28

ok. i will rescale my pattern. It was my fail(


Re: Minifigs Patterns - Damien Roux - 2011-08-28

Uploaded on the tracker:
Link


Re: Minifigs Patterns - Stan Isachenko - 2011-08-28

[Image: 9d6a7dff.png]
Emperor Palpatine was very unfriendly. I spent a lot of time on him, but not very successfullySad If someone want you can rework him. SVG file here.


Re: Minifigs Patterns - Travis Cobbs - 2011-08-28

Yes, converting the polygon to triangles is straightforward (with the proper libraries). Additionally, having front ones "hide" back ones is also easy (polygon binary operations are standard, and in this case the difference operation would be used to subtract the front polygons from ones behind them). All of this is stuff I will be doing, but getting the polygons in the first place was the hard part (with paths).


Re: Minifigs Patterns - Damien Roux - 2011-08-28

Good news!

Travis, was the file I sent you with polygons good enough for what you need, or does it still need some changes?


Re: Minifigs Patterns - Travis Cobbs - 2011-08-29

I just got far enough to be able to sanity check my work, and both simplified ones seem to have worked. I'm parsing all the paths, but for each curve in the paths, I'm simply using a straight line between the curve's start and end points. This seems to produce a good result with your simplified Imperial Guard torsos. One of the two is inclosed in a white box, though, which isn't really desired.

I still have to update my code to do the polygon difference stuff so that stuff in front covers over stuff in back. And I'll at least try to get curves inside paths to work. However, I'll post something once I have the polygon difference stuff in.


Re: Minifigs Patterns - Travis Cobbs - 2011-08-29

Thanks for the heads-up. SVG files don't use splines. They instead use quadratic and cubic Bézier curves. I'm hoping I'll be able to find some sample code for converting these into polylines with a specific "angle between segments" threshold that I can set. Otherwise they're going to be a pain.

Oddly enough SVG arcto commands are a pain to process also.


Re: Minifigs Patterns - Travis Cobbs - 2011-08-29

At the bottom of this message is a link to an initial demo of my work in progress.

There are some important notes (READ THESE!):
  • It creates a .ldr file with the same name as the input .svg file, overwriting any existing .ldr file with the same name without prompting.
  • It doesn't properly support any kind of curves inside paths (cubic Bézier, quadratic Bézier, arc). Instead of drawing a curve, it draws a straight line between the two ends of the curve.
  • It isn't fully working with winding rules (odd/even, non-zero, etc). This means that some files look great, while others have overlapping (co-planar) polygons.
  • It only supports a small subset of SVG. In particular, references to named items don't work, nor do coordinate transformations.
  • The output is all triangles; anything that would have generated lines is ignored.
  • I haven't checked if the output triangles all have the same winding (for BFC). I believe that they should, but haven't checked.
  • The only SVG nodes supported are switch, g, polygon, path, rect, and circle.
If you still want to give it a try, go ahead. It's a command line program, and expects the filename of an SVG file as its first (and only) argument. Here is the link:

http://www.halibut.com/~tcobbs/ldraw/private/SvgToDat-001.zip


Re: Minifigs Patterns - Stan Isachenko - 2011-08-29

[Image: ade57721.png]
Anakin Skywalker. Svg file. This image has 20x scale.


Re: Minifigs Patterns - Damien Roux - 2011-08-30

Works quite nicely.

I gave a try with Vader's pattern (above), and I had to modify the pattern a bit (grouping each color in a polygon, with no overlapping areas). The file is here.

Problem I have is that it's giving me lots of T-connections. Do you know where does the problem comes from?

But, anyway, many thanks, you did a great job, keep on goin'!


Re: Minifigs Patterns - Travis Cobbs - 2011-08-30

To be honest, I'm not sure where the T-connections are coming from. I suspect it's when the upper polygons are subtracted from the ones underneath them. The tesselation (turning the complex polygons into triangles) shouldn't introduce any, since the GLU tesselation library I'm using is, by definition, intended to be used with OpenGL.


Re: Minifigs Patterns - Travis Cobbs - 2011-08-30

I mentioned it somewhere else way up the thread, but I'll repeat it here, since it still applies. Some of the SVG files from Illustrator posted in this thread have a node at the beginning that the XML parser I'm using is unable to parse.

If the program doesn't produce a .ldr file at all, open the .SVG file up in a text editor. If you see an XML node near the top with a bunch of stuff enclosed by square brackets ([]), delete the brackets and everything between them. The node should look something like this:

Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
        <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
        <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
        <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
        <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
        <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
        <!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
        <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
        <!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
]>

After editing, it should look like so:

Code:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

Ignore all semicolons in the samples; they appear to be due to a bug in Phorum.


Re: Minifigs Patterns - Tim Gould - 2011-08-30

I was looking up Bezier curves to see if there was anything quick I could do to help (it would appear not) and noticed that True Type Fonts use Bezier curves rather than splines. Which means Rosco's code most likely has what you need.

Tim


Re: Minifigs Patterns - Travis Cobbs - 2011-08-30

Thanks. I'll take a look.


Re: Minifigs Patterns - Stan Isachenko - 2011-08-30

Sorry not in this topic(


Re: Minifigs Patterns - Damien Roux - 2011-09-01

To those who want to try SvgToDat (and maybe also for Travis he he's still trying to improve the prog):

After some try and some patterns authoring, I can say that at the moment, the best is to avoid overlapping areas in the SVG file, otherwise there will be a lot of overlapping triangle after conversion. This can be done easily in Illustrator.

Then, as the program only takes splines anchor points into consideration, the curved path have to split into smaller straight lines. This can be done in Illustrator by adding control points and then by using the "simplify" option with straight lines.

Then, when all colored area are polygon (one group per color) the program can be ran and gives really good results.

But it's not over yet: colors has to be change manualy to Ldraw ones using MlCad or whatever program.

Then, sometimes there are BFC problems, so this needs to be checked with LdView.

After that, there is a good chance that edger2 will find many unmatched edges. I was able to correct that using unificator. It should work for almost all the gaps.

Finnaly, decimals needs to be rounded, and triangles converted to quads if possible (using Datheader for example).

This is the procedure I used to make 3068pb12. I ended with only two errors caused by very flat triangles and quads, nothing really difficut to handle apparently.



This is my feedback, I hope it will help Travis to improve this wonderful program, and help users who would like to use it.
If one has some questions about Illustrator, I can do my best to help, but I'm not a guru at all. I first really started to use it last week when Stan gave his torso patterns. But as I knew Photoshop already, Illustrator was not that difficult to handle for basic things like drawing a 2D pattern.


Re: Minifigs Patterns - Stan Isachenko - 2011-09-02

Not minifig, but pattern. Dish 6 x 6 Inverted (Radar) with Star Wars TIE Advanced Hatch Pattern File id here