I tried Eagle BRD file import and I can see only top layer imported.

I tried Eagle BRD file import and I can see only top layer imported. This gives me pads only for single layer and top only for two-sided PCBs. How do you manage your boards import?

If you’re up for helping out, we could use some help on enabling the bottom side feature directly inside the widget. However, there is also the “mirror” command inside Eagle that will let you save out the bottom of your board as the top to a separate file so you can import into CP.

For starters, if we want to render the bottom layer the way it looks in Eagle, my thoughts are:
Replicate Javascript lines 536 - 537 for bottom layer, creating a
colorSignalBottom: 0x23238D
colorSmdBottom: 0x23238D

Now, starting at line 565, we would need to call the functions draw3dSignalWires, draw3dSignalPolygons, and draw3dElements again with ‘Bottom’ as the given parameter. These functions seem very versatile and seem like they can handle any layer thrown at them, the problem is that they have colorSignal hardcoded into them. A quick hack might be to to put a huge if case inside the function to determine which layer was specified for processing - if Top then the function as is, if Bottom copy and paste the entirety of the function but change the handful of times colorSignal and colorSmd is written to “” ""Bottom.

Another way might be

(variable I don’t know which type you used off the top of my head) tempColor = null;
if (layer == Top)
tempColor = colorSignal;
else if (layer == Bottom)
tempColor = colorSignalBottom;
else
return;

change all instances of ColorSignal in function to tempColor, repeat this block for Smd, and then the same needs to happen in the other two functions I mentioned above.

I haven’t gotten into the gcode portion of the code yet but off the top of my head I think the toolpaths need to be rendered separately. Store the bottom features of the board in a separate set of Arrays, mirror by (new x location) = (total board x length) - (current x location) and the same for y… and then run everything through the toolpath creation functions again? A simple toggle for dealing with the top side or dealing with the bottom side. The reason I brought up rendering the entire board at once in the beginning is for the user to be able to see that all the features were interpreted correctly by CP, but I think the toolpath creation should be dealt with one side at a time.

Let me know if any of this makes sense.

@raykholo I think your approach sounds really good. One idea is to perhaps put a dropdown with Top and Bottom in it and if there are other layers also put those in it. Default it to Top. Then if the user swaps to Bottom you simply re-render everything from scratch and the user is then working on the Bottom of the board. So they could mill the top of the board then they could go back to the Eagle widget and choose Bottom and then mill the bottom. It would be up to the user to line things up when they physically flip the board.

Another idea is to allow the user to do a side by side milling job where you take thinner FR4 and mill the top and bottom side by side and then just epoxy them together after ChiliPeppr cuts them out.

@jlauer I have the bottom layer displaying but it is still the primary color. Not bad for copy and pasting 3 lines of code.

Personally, I’d love to see a full board render happen in CP. It really helps me see my designs from a new perspective, and I’m talking about design review, not milling. When I was writing my spiel above I had the thought about more than 2 layer boards but couldn’t see the immediate need, but your last paragraph about adhering boards together justifies it.

So, in order to be able to render a board up to 16 layers… The layer numbers are always 1-16 and they go in incremental order. Users can specify whatever numbers they want and the names are something like Route2, Route3, Route15 where the # is the same as the layer #.

Instead of searching through all the board layers by name ‘Top" or "Bottom’, I recommend running a for loop with layersByNumber 1 - 16 inclusive and if a particular layer exists adding it to an array of layers in that order. I don’t believe such an array exists yet, but it needs to.

Once we have that, we can populate a select multiple element located at the top of the render tab with all the existing copper layer names from that array and each one can be turned on and off but by default all are visible.

To render the preview we loop through each element of the array calling the 3 SPE functions (Signals, Polygons, Elements - they need a cool nickname, so SPE it is) for each layer. There’s no way we’re doing blind or buried vias here when half the board houses won’t even do them, much less the technical reasoning, which means simple vias that go through each and every layer of the board: if the top layer has it, every layer has it, which means we only need to render it once. Same for the board outline, it’s consistent which means we can just take it from the top layer and be done.

I noticed there is a “EagleCanvas.prototype.mirrorLayer” function. Does it do what we need it to? Some of what I’m seeing makes sense, or at least my interpretation of it makes sense to me. In a multi-layer board there is always a top half and a bottom half, where everything below the middle of the board has to be mirrored. But the layer numbers don’t always break between 8 and 9, for example I could have a 4 layer board with 1 (Top), 2, 3, 16 (Bottom). The answer is to find the midpoint of the range and mirror all layer #'s above that midpoint.

As for milling, I agree, there should be a dropdown below the select multiple (and a hr divider between them would be nice too) populated with the names from the elements array and the user selects one. Then that one gets gcode created for it and we go from there.

I’m not sure yet of how to implement tiling but it essentially involves a way for the user to select multiple layers to tile, and moving those layers around by the x and y lengths of the board outline + user settable clearance between boards (by default set to end mill diameter or 1/8" is a good figure). Then that whole design gets passed to the gcode creator as one large board.

I don’t see a layer translate function but it’s just basic addition of the coordinates.

Yeah, I’m with ya on everything you said. I think this is all closely within reach given the framework in place already with the Eagle widget. As you can see from the code it’s quite extensive what I’ve already done to get the board to render. I agree with you that this Eagle BRD Import widget gives me a whole new view of my board and frankly is almost nicer to use to see all my traces and signals over what Eagle gives. We are like 95% there with being able to render Bottom or other layers. I do think if you do the ganging up technique of milling out layers side by side that you could do blind/buried vias because you get to control how you epoxy the layers together and you can just drop solder into your buried vias to get them to conduct.

@jlauer ​, @raykholo ​ Thanks a lot for all your response. I was not expecting such a long and detailed output :slight_smile:

I think having a widget with the option to choose Top or Bottom layers for milling is a functionality expected by the ChiliPeppr community. The preview for all other layers available in Eagle is very nice, but I think most people make one and two sided boards only. I see it difficult to maintain all vias if more layers are present. Buton the other side rendering more layers than only two is great from checking them visually and see the full board before sending to production. Just maybe switching render operation on/off per layer isn’t a bad idea. I will be more than happy to help

@raykholo ​ Your detailed explanation is excellent.