pcb

Outline, masks, and mm's

Bug #699480 reported by patrickpg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
In Progress
Medium
Unassigned

Bug Description

This patch adds the following new features:
* Outline. If a plane named "outline_fab" is found, i) its lines, arcs, and poly are drawn into the fab as 10mil lines ii) the bounding box is extracted iii) offset and dimensions are printed into the fab. It is an extension of the previous "outline" plane which skip polygons and arcs and which skip the dimensions display
* Outline on planes. All planes have got a square outline drawn. I understand some people does not want it, they can be deleted with a recent version of gerbv or if somebody knows and wants to play with the configure script, I can make the update to have it optional ( via the -d DONTWANTOUTLINEONALLPLANES compilation option )
* If an outline_data plane is found, it is merged in the fab. The difference with the outline_fab merging is i) all the shapes are drawn as it and it is not counted into the bounding box
* If planes with names component_mask or solder_mask are found, their content are merged with the masks outputs ( all shapes "as it" )
* Dimensions are displayed in the fab with the mm conversions
* If no component plane is found, the cnc files are merged into one un-platted file and the yes/no in the column platted are replaced by not applicable.

Please note the additional "group" outputs are still issued, people may want to not send them to the provider

TODO

* Debug ( including verifying the behavior of the old outline plane remains the same for compatibility reasons )
* Finish the extraction of the bounding-box of arcs objects. Still to be investigated as it look like only arcs starting and ending at 0, 90, 180, or 270 degres are possible which makes thinks easy. Otherwise an exact calculation have to be done but I have no idea about the porting of calls of sine and cosine functions to all platforms.
* Find a way to allow open polygon outlines especially for internal cut out on the fab.

Enjoy!.

Revision history for this message
DJ Delorie (djdelorie) wrote :

Why not add to the existing outline layer?
The do-I-want-outlines option and the mm conversions should be export options in the various exporters, not compile time options.
Arcs may be any angles, not just multiples of 90.

Please take out LocationTypeMax/Min - we don't want arbitrary limits, and if we needed type-specific limits, we should use the standard ones like INT_MAX. Better to have a flag that says "unset" to force the first point found to set the limits.

You spelled Square wrong

Revision history for this message
patrickpg (patrickpg) wrote :

Hi

OOOPPPS sorry for the INT_MIN and MAX it was a temporary solution in the meantime I find the correct one. I will move to the unsed.
I don't have time to study the GUI for adding export options, does somebody know it by heart?
For me the mm's and inches should be always here as today we don't know where your provider sent your Gerber in the world, or even where he ordered the drills.
I needed at least a second outline plane to draw cotations, write remarks etc... I could have reuse the previous "outline" for the "outline_fab" but I prefered to keep the same behavior for people who already used the old one. They may have use the polygons or arcs as a help since theese shapes was voided on the output.
Since arcs can be everything, I have to use sine and cosine. Is there some macros defined to allow to compile on many plateforms? I will not be abble to try on other plateforms than Linux. To be honest I tryed to keep some style but I didn't write in pure C for about 15 years, as I am using c# and c++, it explains also the min max.

Also a quick question : should I post also an md5sum? and may I compress with bzip2?

Revision history for this message
DJ Delorie (djdelorie) wrote :

Export options have nothing to do with the GUI; look in the png exporter for lots of examples of how to code them.
I don't mind inches *and* mm, but parts of your patch *replaced* inches with mm.
I would add arcs and polygons to the regular outline layer, and add an "annotations" layer for non-outline fab notes. Or call it "fab_notes" :-)
sin() and cos() are standard, just make sure you #include <math.h>
bzip2 is OK. Note that I had to gunzip your file *twice* before it was plain text.

Revision history for this message
patrickpg (patrickpg) wrote :

Perhaps the first version may stay as it with the outline on all planes always on as I don't have enought time to investigate. Also I will post a question in the forum to see if some people does not want it.
No the mm's are displayed in brackets after the inch/mil values. The patch can give the feeling the inches has been removed ( especially I placed in a squarre object the values before display, that could have remove some old outputs )
I can not just add the polygons on the outline. The previous implenentation was only to change a message and to draw a 10 mil line, I am not rewritting everything. The behavior was to change the message "... squarre ... 10 mil line ... offset 0, 0 size 123, 456" into "the center of this 10 mil path". Now I am using the outline to calculate the bounding box, then I have to display also the offset and the sizes, and that was the motivation as my provider asks for the dimentions of the smallest squarre around. I wanted to keep the compatibility with the old outline plane. However I understand some people ( and me ) wants the new behavior. Then now I am checking for the outline or outline_old plane, the old is marked by a flag. The code has been extended to draw also the polygons ( transformed into a serie of 10 mil lines ) but the flag "old" skip this part. Also the flag print again the old message without cotations
The outline_data has been rename into fab_notes
If math.h and sin() cos() are fine for you, it is fine for me. I compile PCB on Linux with gcc on an opteron machine using a radeon video card, I have no idea of the porting people could have make. As the admin you know better than me.
I come back to the min and max. I didn't find an unset flag in the box type. The I only change the +-1000000000 by INT_MIN and INT_MAX. However I would like to keep the definition like I did. Indeed the definitions one line bellow the general PCB measurements ( today set to int ) make things visible. If tomorow somebody submit a patch to move the unit from the 1/100th mil to 1/1000th, he may want to change the int into long long. Since INT_MIN and INT_MAX are numbers, the software is then wrong until the bug is found. Here bellow the definition, we can see there are INT_MIN/MAX to be changed into LONGLONG_MIN/MAX.

Next version of the patch will come on the begining of the week.

Revision history for this message
patrickpg (patrickpg) wrote :
Revision history for this message
patrickpg (patrickpg) wrote :
Revision history for this message
patrickpg (patrickpg) wrote :

This is the new version of the patch

I found how to add options to export modules, and now there is a check box to get the outline on all plane. However the outline is for the moment always active. the option array is visible only to the export module. However data come from an extraction in the print.c file.
That means I have to add one parameter to the base polymorphism hid_expose_callback , I wouldn't use a global variable for that even if the export dialog is modal.

The arcs in the outline layer now extends ( if so ) the bounding box. It was first design as an algorithm that considered the start and end point and search for all the point in between that are multiple of 90. It didn't work as it look likes the angles are always between 0 and 90 and the heigth and the width tell in which quadrant is the arc. Is it always true?

The file is attached. Enjoy!

Revision history for this message
DJ Delorie (djdelorie) wrote :

The rule about HIDs is that the HID can do whatever it wants to the core, but the core can only use the HID interface to talk to the HIDs. So, if you need to set up some global table of which layers get exported at what times for your hid, go ahead.
Arc start angles can be any angle, the width and height are always positive. Delta angle can be anything also.

Traumflug (mah-jump-ing)
Changed in pcb:
importance: Undecided → Medium
status: New → In Progress
Traumflug (mah-jump-ing)
Changed in geda-project:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.