Please re-add support for Targets!

As the target handling code is still present in KiCad maybe a Python plugin could be produced to add the UI requested by OP.

1 Like

Or just copy the prior Kicad code for the UI and update it as a plugin.

So long as the target object for rendering is still in Kicad, Adding a target is:

" (target plus (at X, Y) (size 5) (width 0.05) (layer Margin) (tstamp HEX)) "

written to the .pcb file.

1 Like

As a compromise, keep this text saved somewhere.


(kicad_pcb (version 20240108) (generator "pcbnew") (generator_version "8.0")
  (target plus (at 0 0) (size 5) (width 0.05) (layer "Margin"))
)

Copy it to clipboard. Paste it to the board in the PCB Editor with Ctrl+V.



Change the properties as needed. (Shape is 0 or 1.)

4 Likes

I verified this in V8.0.4 and it works.

And this is also the normal way Copy & paste works in KiCad. For example:

  1. Select any object.
  2. Press [Ctrl + c] to copy it.
  3. Open a text editor and paste it there with [Ctrl + v]

Your object will now be pasted as text in the text editor.

So instead of keeping the text around, you can also copy the target from any PCB (template) that has one and then paste it in the other project.

Or make a template that already has some targets on it and use that template to start new projects from.

1 Like

Yes, but then there needs to be some means to let KiCAD team know that the handling code for targets might still be used in later versions of 8.x , future KiCad V9.x, 10.x and so on.

The use of the handling code needs to be documented. Otherwise stuff might break in the future.

From a software support process - it’s better that it gets logged into KiCAD development - even if the target code is simply tagged as supported by user written UI.

1 Like

Targets should not be placed on edge cut or the margin layer. That results in an exclusion of the copper fill around the target.

Instead a better choice is to place the Target on the “Dwgs User” layer.

(kicad_pcb (version 20240108) (generator “pcbnew”) (generator_version “8.0”)
(target plus (at 0 0) (size 5) (width 0.05) (layer “Dwgs.User”))

Again this presumes that rendering of the “target object” isn’t removed in later versions of KiCAD. It would be better if the support for target remained but the layer can be selected.

See:

)

I agree that these targets should not be placed on the margin layer. But in this thread it is mentioned a few times to add them to the margin layer, so that is a bit contradictory.

I have not re-read the whole thread. It looks like you are mainly using the target as a sort of extra snapping point inside KiCad. There is a need for improvement here, but I am not sure what direction that improvement should be in.

Not used for just snapping, but as a dimensional layout tool. Instead of using a separate CAD tool for the mechanical layout. It’s possible to place targets and and lay out the the dimensions, then connect the points with either edge cuts, margins, or using the targets to place the mount holes precisely.

Then if we find the board size has a problem (mfg says it’s too small or too large for price bracket). The critical points in the layout are still there in the targets, even if you’ve deleted the edge cuts and removed the margin layer. It’s possible to then nudge the targets corners that need to be moved and then quickly set edge cuts , margins and zone fills.

So you’re using the targets as (semi) temporary reminders of coordinates and “stuff”.

I (think I) understand your point, but I do not find it very convincing. To me the targets do not have any sort of meaning, and when I see one, I do not know it’s purpose.

Consider this method:
If you want to modify Edge.Cuts, then first make a copy of all lines on Edge.Cuts, and place that copy on a user layer. You can rename the layer to “Old_Edge” or whatever. This gives you snap points to all old coordinates of Edge.Cuts, and you can always compare differences between the old and the new.

And that is probably part of why targets were removed from the UI in the first place. But I’m still curious if you have a use for them which does not have a better alternative.

That was one example of the use of the target.

Targets are fiducial marks much like some of the other drawing and fab layers. The original use as a point on the board so you can align multiple layers of mylar has long ago been replaced with the better PCB cad tools like KiCAD.

They can also be placed as reference points for the measuring tool. That’s another area where I use them frequently.

The reason why targets became a thorn in the side of many was the impact that the target had on the outside board cuts and the zone fills. The solution to that problem isn’t to stop supporting targets - it should have been to move it to a drawing layer where it doesn’t interfere with zone fills.

The UI simple fix is to allow the KiCAD user to specify the layer for the targets without using a manual editor. And to prevent confusion move the default target off of the edge-cut to a drawings layer. If someone wants it back on edge-cut or margin - the right click on the target and select the layer.

Why not make targets as footprints in a User Layer?

ksnip_20240923-133641

Targets were an object previously in KiCAD. As such it is an object that may exist in existing PCB layouts. Targets remain as objects in other CAD tools.

If support for targets is deleted in future versions of KiCAD - existing older projects may loose content and function.

Foot prints are generally top and bottom layers, while you could create a foot print on a specific layer - it then becomes a matter of processes much different than PCB layouts of years gone by and other vendors.

Kicad, now days, has nine user layers onto which you can place, mostly, whatever you want. Does this makes Kicad “much different” in processes to other vendors?

How?

If the older version is opened in a newer Kicad, the targets will still show.
If the old board needs modifying, the old targets may no longer be of use, but that is probably a plus because the old targets, it seems, were on the Edge cuts Layer.
As I mentioned above, create some new targets or otherwise, use a few graphic lines on which ever layer you desire.

The software developers at the present time only removed the UI interface to add targets, but they left in (for the current time) the rendering of the targets.

I’ve brought in older KiCAD 5.0 designs, and am able to click on the targets and move even in KiCAD 8.04. You just can use a KiCAD button to drop a target on the board. You can duplicate a target and place.

But the biggest issue with targets - were that they were fixed to the edge cut layer UNLESS you used a text editor to manually move the target to other layers. That remains the issue today.

The better method would be to add the layer choice to targets with a right click, create them on a Drawing User layer.

Some PCB shops still prefer a target that is on a copper layer – because they use automatic computer recognition of targets for board alignment of the pick-n-place… (some not many any more). But targets are also useful for leaving a persistent measurement reference point on the boards. AND targets are available on other PCB CAD tools so there is a reason for maintaining some degree of similar functions.

This can easily be done with a custom footprint

1 Like

It’s unlikely they will completely remove targets. They are rendered now, because “they” want to maintain backward compatibility with old projects. This is an important point for KiCad, and not likely to change.

Indeed. I also have not seen any example here of something that can not be done just as well or better with a (custom) footprint. Apparently Dennis_Heidner is not interested in this, and I’m getting annoyed by the constant bumps in this thread, so I will set it to “Muted” to fix that for myself (this has no consequence for anyone else).

There should not be a need for KiCAD users to create custom foot prints for a simple target.

Instead of promoting better & common ways for PCB layouts - that custom foot prints of common objects promotes diverting paths.

You haven’t paid attention to all posts. You can change the layer in the Properties manager.

Also, have you actually tried all other suggestions? Have you tried the “center dimension”? If you want a crosshair look, you can group it with a circle.

I’ve got a feeling that you are somehow fixated to this one KiCad object. You have several options to help with your workflow, but have you tested them with open mind? You just add post after post telling why target is good (although most of us don’t seem to have even noticed the lack of it) and footprint or something else has this or that wrong, and I don’t even understand what you mean by “better & common ways” or “diverting paths”. I can’t help getting an impression that you are making excuses. You would be more convincing if you would show that you have actually tested all the alternatives thoughtfully and thoroughly and show where exactly they are deficient. To me it looks like you have skillfully dodged the answers to your complaints.

As for the fear of ending support for targets totally in KiCad – I’m not a KiCad developer, but I have followed the development several years closely and read some of the source code. I agree with Paul: removing the support is very unlikely.

First, it won’t happen by accident, nobody will change the code that way. I say this because I have read a part of that code which handles targets. I have worked as a software developer and have been involved in other Open Source projects, and I have seen and can understand that sometimes an implicit undocumented feature can be removed by accident. But support for targets in KiCad is explicit, it can’t be deleted accidentally.

Second: actually I would say that purposefully removing the support would mean more work than just keeping it. It’s mostly maintenance free (an actual KiCad developer can correct me if I’m wrong), and removing it would require going through the code, testing etc.

Third: Paul, again, said this already: for the developers keeping old designs lossless in new versions is important. Removing targets would mean needing to convert them to something else, which would need more work than just keeping it.

So, I don’t see how it would be removed from KiCad.

Targets can’t be added to a design through the normal GUI, but as we have seen, it can be added by copying and pasting (in the GUI from another design, or in text format). And they can be modified with the Properties panel. If you need something else, please read the thread again and try the alternatives for real without prejudice.

Targets can’t be added to a design through the normal GUI, but as we have seen, it can be added by copying and pasting (in the GUI from another design, or in text format). And they can be modified with the Properties panel. If you need something else, please read the thread again and try the alternatives for real without prejudice.

Since copy paste can be triggered through python scripting nothing really stops a add-on author of adding a icon to add the function to the GUI if its a usability issue.