Here is how I've rebuilt the stator of my bike, a Yamaha yp250 scooter, branded here in Italy as Majesty 250. It might be also valid for other brands.
The original part is WAY too expensive here (more than 600$), so I HAD to invent ways to solve the problem. I drove the bike using this rebuilt stator for about 600 miles now and its still working. Im not sure that the insulating paint I've used will stand the eat from the engine motor oil as the original.
So far so good....
Step 5 has a picture with the complete schematic of the wiring.
Suggestions and criticism are welcome.
Step 1: Original Stator.
This is the original faulty stator. It has all of its 3 windings shorted to the metal body.
Step 2: Uncoiling the Thing
This is a quite tedious job, as the epoxy is quite hard to remove. You might need the help of a screwdriver to lift up the wire inside and between the poles. Be careful while handling the copper wire as you unwind it. Some of its insulating paint bits, still attached, are sharp and might cut your skin.
Step 3: Preparing the Support
Before recoiling the stator, make sure to prepare its surface, smoothing out with a file (or a minidrill) all the sharp edges. In my case this step was absolutely required as I mistakenly removed the epoxy residuals (as you can see in the first picture below) with a paint removal gel. I had to prepare 36 small pieces of mylar cardboards (same used in transformers windings) cut in right size and cover with them all the poles.
Step 4: Coiling Up!
Get some awg (diameter) enameled copper wire (transformer wire) as the original. In my case that was 0.95 mm diameter. I got mine from an electric motors rewinding shop. While you ask for the wire get also some insulating paint. You'll need it later.
Highly recommended tip: while winding the stator, hook a digital multimeter to the metal body and to the fixed end of the phase you're winding. In case of shorts between the metal body and the wire on sharp edges the multimeter (set on diodes or continuity) will buzz and you can quickly unwind and take necessary action. (e.g. move the coil in a different position).
Step 5: Completing the Job
Once all the poles have been completed, the most is done. The whole stator need to be submersed into the insulating paint and put in oven to cure at 300F for 30 minutes. I did this twice to make sure a tick layer will form.
After the paint has cooled its just a matter of soldering the connector wires back.