ID: | 3273 |
From: | ge...@igor2.repo.hu |
Date: | Tue, 13 Aug 2019 10:51:54 +0200 (CEST) |
Subject: | Re: [pcb-rnd] multi-object shape |
in-reply-to: | 3272 from pc...@cuvoodoo.info |
On Tue, 13 Aug 2019, pcb-rnd@cuvoodoo.info wrote: >I am trying to draw a rounded rectangle pad (padstack) in a footprint/sub-circtuit (subc). >as specified here: http://repo.hu/projects/pcb-rnd/developer/lihata_format/tree.html >the padstack_prototype contains ps_proto_v4, which contain ps_shape_v4, where you can draw either of those object: line, circle, polygon. >there is no rectangle shape. this must be drawn using a polygon. Correct. >but polygons only are a collection of straight lines between points (as described here: http://repo.hu/projects/pcb-rnd/user/02_model/index.html). >no arc, thus no rounding is possible (except using approximation). Correct. For small pads, approximations of 2..4 corners are usually good enough. >to circumvent this issue I thought about creating a padstack with multiple elements: a polygon with cut corners, and 4 circles for round corners. >this issue is that (AFAICS) ps_shape_v4 only supports one object (the following are ignored), and the ps_proto_v4 only supports one shape per layer combination. >thus I am no able to have a multi-shape padstack prototype. A padstack, light terminal, is an optimization. It runs much faster in code and takes less bytes of data (in memory, in file) and provides a somewhat declarative, computer readable description of the common cases (which means we can have nice dialog boxes for them). In return, it comes with limitations. By design, a padstack can have only one shape per layer type and the shapes available are only a few and are very simple. This is not an issue, and is related to verison: this is what padstacks are designed for. >could it be possible to have multi-object shapes, or a multi-shape prototype? Not in a padstack. >if not, what is the reason? Because then padstacks wouldn't make sense. I mean if it was just "throw in random objects on random layers", we already had that long before padstacks. That setup is called heavy terminals: you just use plain drawing objects on specific layers and use the same terminal ID for them all, to indicate they are all for the same terminal. Any amount of object on any layer can make up your heavy terminal. >I see one possible difficulty: finding the center of the prototype when there are multiple elements. These are called shapes, not elements. And there are a lot more problems than finding the center. So no, we are not going to convert padstacks into heavy terminals, because then we would just have the same feature twice, while we would lose all the extras padstacks provide now. I am not 100% sure what your specific use case is, but I can tell how the usual cases are handled. If it's oblong pad, it's normally a line (because line is round cap) shape in a padstack. If it's rounded corner rectangle where rounding radius is smaller than 50%, just do an approximation with polygon shape in a padstack. Use heavy terminals only if you absolutely need to, e.g. for paste patterns on large pads (but even then the base pad should be a padstack and only the paste pattern should be separate objects with the same terminal ID). HTH, Igor2
Reply subtree:
3273 Re: [pcb-rnd] multi-object shape from ge...@igor2.repo.hu