# How to get a row of single-file particles?

I'm trying to make a "crown"-like rim for a box, where the result should be similar to this picture:

The idea being that there are several triangle-meshes right next to each other in a row, without any overlap, and their direction is based on what part of the box they're on (x axis, face towards y, if on the y axis, face towards x), like the rim in the picture.

I tried doing this with the Hair Particle system (after making a mesh for the rim), and the result is like this:

First of all, the triangles are ot facing the appropraite direction, they're all facing the same way, only the ones on the x axis are faced the proper way, but the ones on the y axis should be turned 90 degrees. Also, I they're randomly spaced, I need them to be back to back with no space in between. Any ideas?

## Steps:

1. Create a simple Plane (size x:4,y:2,z:0) and Alt+C > Curve from Mesh/text.

2. Go to Data tab and set Resolution > Preview to 64 and check Bounds Clamp.

3. Create another Plane and make an triangle out of it in Edit Mode. In Object mode set Scale to 0.1.

4. Add to it Array and Curve modifier.

5. For Curve modifier select Plane.

6. For Array set Count based on sum of length of the first Plane divided by the X lenght of the triangle.

For example in this case it looks like this: (2*4 + 2*2) / 0,2 = 60.

Note: It's crucial for Array on Curve modifier that both object have the same origin point.

• in addition to #6: set the fit type to "fit curve". it both works, but if you have a curve shape thats more complex than a rectangle, you don't have to do crazy maths to fit the array length Feb 16, 2018 at 10:08
• @bstnhnsl Fit Curve will not work. And this "crazy math", as you called it, is needed to have even, sharp corners. Like in real world. Also with complex shapes - you only need X width. Feb 16, 2018 at 11:15
• I like this answer 'cause you can #1 edit the mesh later, #2 use it for other curves if you don't care about exact angling (just manually adjust the scale of the mesh to fit the ending), but it would be cool if there's a way to set the scale of the object (and the array count) (with code I guess?) based on how long the curve is Feb 16, 2018 at 22:09
• @Yaakov5777 I think it could be possible with Python but I do not have necessary skills for this. I also thought about some simple formula to paste in Count value (or maybe using drivers?) to get length values from the plane and triangle, but again, I don't know how to make it. Feb 16, 2018 at 22:19

Instead of using particles, 4 array modifiers might be better.

Model one triangle, copy and rotate it 90° and give each one an Array Modifier.

Duplicate for the other sides. You can duplicate with ALTD instead of SHIFTD if you want to change the shape of your teeth later.