Use Image as outline "stencil" for PC layout?

Is there a way to use an image, such as a jpg, as a “stencil” to model my PCB outlines around?

I need to make a PCB to fix in an existing enclosure, and I need the non-plated mounting holes to line up perfectly, and the only way I can get it done perfectly is to scan the original mounting plate.

Out of the scematic editor press F8 to update PCB from scematic. Alternatively click Tools/Open PCB Editor or click the icon in the top toolbar. In Pcbnew click File/Import/Import Graphics. Select your outline.dxf and import it to dwgs.user. That’s it.

I’ll give it a try!

Thanks!

Ensure your photograph is at the proper Scale!!

As an aid (if needed after enough frustration) use an App I wrote for doing exactly what you’re wanting to do.

It’s perfect for using as a tool to aid with your Kicad needs.

Basically, it wont matter if the Photograph is at scale as long as you KNOW one Real dimension of an object in the photograph.

With that One dimension, you’ll scale the placements of what you need in the Kicad PCB.

There are Video Examples posted for the App…

Thus, Grab your photo and place it in Kicad’s PCB, use the App with your known dimension and place your Stuff where needed…

App and Video examples located at: https://github.com/farTooOld/Woof

Um… How exactly does one import a jpg as a dxf?

Here’s a simple approach without using any extra tools…

Know One distance to use for the scaling (Scale Factor).

  1. Click the Bitmap Converter tool (Icon with letter ‘a’ in toolbar.
    Load your jpeg into it.

Use the resolution slider to get a reasonable presentation of an area with the One known dimension.

  1. Export for PCB (it creates a .mod file (it’s a Footprint). Save it to location where your footprints are located.

  2. Open your PCB file and place the new footprint.

  3. Use the Measure tool to measure distances of the Known item.
    Most likely, it will not be correct and needs scaling.

Let’s say the measured distance is smaller than the Actual distance. Therefore, Scale Factor is Actual/Measured

  1. Now, draw your items at positions using the scaling.

Example:
Using a Pickguard I made for my D’Angelico guitar with a Known distance from Screw1 to Screw2 (dist = 147mm). Image 1

Note: I did not fuss to change grid so, I only placed close enough for this example…)

• Loaded the jpg photo into Bitmap Converter
• Set to Black & White and resolution slider to see the Two Screws
• Exported for PCB on F_Silk_Layer
• Placed the exported Footprint (image 2)
• Used Measure Tool to measure dist between screws.
It measured 131.4
Since actual is 147, ScaleFactor = 147/131.4 = 1.11
•I placed a hole on edgecut layer at 147 and any other items for image3
placement use their Measure_Tool dist multiplied by the Scale Factor.



Rather than struggle with scanner scaling, I would use FreeCad and measure hole to hole directly and use these values as constraints. Finally export to DXF.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.