Repository navigation
Replies: 18 comments 6 replies
|
Looked at how other electrical CAD tools (AutoCAD Electrical, EPLAN, SEE Electrical, Zuken E3, WSCAD) handle this, since a couple of the open questions above already have an established answer in that world. Caveat up front: this is from general familiarity with how these tools work, not something just verified against their current documentation — treat it as "here's the established pattern," not a cited spec. The short version: they all split this into two completely separate concerns, and it maps onto the two-step proposal above almost exactly. 1. Model space is always true scale, full stop. Devices are placed using real physical dimensions in real units — never a zoom level or display convenience. Nothing about editing or viewing ever rescales the underlying geometry. This is the classic CAD "model space vs. paper space" split, inherited from general mechanical drafting rather than being electrical-specific. 2. The sheet is a separate object with its own explicit scale. Each sheet/layout has a standard paper size and an explicit ratio (1:1, 1:2, 1:5, 1:10, 1:20 are the common ones) that maps the true-scale model onto that sheet for printing. Different sheets in the same project can use different scales. Nothing is derived — the user picks the ratio. That's exactly step 2 above, once step 1 (named paper size) exists. 3. Schematic symbol ≠ physical footprint, on the same device record. The schematic symbol is abstract and was never meant to be to scale. The panel-layout footprint is a separate, true-dimensioned graphic attached to the same catalog part. This is the split plc-user and arummler described (symbol folder vs. front-view/thumbnail folder) — not QET-specific, it's how the part database is structured in all of these tools. 4. The footprint carries an explicit mounting/reference point, not just a bounding box. Usually the DIN-rail centerline or a defined origin corner, so asymmetric devices snap correctly and orientation-dependent clearances (keep-out zones) can be enforced. This directly answers the placement-anchor question raised on #723 — "use the mounting point" is the established convention, not a novel choice. 5. DIN rails/ducts are parametric objects with real length, auto-tracking module count / consumed width. 6. Schematic instance and panel instance of the same physical device are linked by tag, so renaming propagates both ways — the "back-annotation" arummler compared to PCB schematic↔layout tools. Standard, not a stretch goal. None of this complicates the two-step proposal — if anything it confirms "named sheet size, then explicit ratio" is the right shape rather than something fancier. The two pieces worth adding as named prior art to the open questions: #4 (mounting point as a first-class part of the footprint, not inferred from a bounding box) and #6 (tag-based link between schematic and panel instances), since both are currently open rather than settled above. |
|
I can print the @IBSYSLevi's graphic on any papersize I want and can see the dimensions of the mounting plate and the components: |
|
I come from a CAD world, AutoCAD, AutoCAD Electrical, Promise.e, RSwire, Solidworks. I love real scale. |
|
Wait till we get to the A4 vs letter wars, mm vs inches :) Lucky for me this is a French project and they invented metric :) and the world has never looked back |
|
I use programs like Word or Excel as a reference. And I actually find this comparison interesting. Word works in millimeters (mm) based on a defined page size (A3, A4, etc.), while Excel works in pixels (px), but also in millimeters (mm) when a page layout is defined. This means that in Excel, there’s a defined ratio between pixels and millimeters. Here’s how I see it: It gets much more interesting when it comes to font sizes, for example; I don’t know how font sizes currently work in QET, but in Word, for example, font size 6 is linked to a specific size in mm, since it’s always the same size on A3 or A4. Then, just like in Office programs, you can scale a page—for example, from A4 to A3—and the objects will become larger. In principle, with this definition—regardless of whether px or mm is used—I would simply make the scaling independent of the page size. Then, elements in a layout can also be defined, for example, at a scale of 1:5, which directly determines how large the element will be on the printed page. Something else I’d like to see added later is a customizable grid increment, similar to what’s available in KiCAD, for example. This allows you to freely adjust how precisely an element can be placed. Currently, I see a limitation in QET here in that the grid cannot be set to less than 1 px. This is where my scaling from mm to px comes into play, since the calculation can result in values like 0.nnnn px, and elements cannot be positioned with that level of precision. |
|
Something else I noticed: When I want to draw a layout, I can’t specify the dimensions of the standard rectangles in mm on a blank page—for example, for the outline of the control cabinet. Currently, I can’t even specify them in px (though that could be fixed). But the problem is then, that the values always have to be changed within the element and can't be freely corrected or adjusted. |
|
Coming back to this after reading the whole thread — I think part of the disagreement is about scope rather than substance, and there's one piece of hard evidence in QET's own code that hasn't come up yet and is worth putting on the table. Scope first, since I think this defuses most of it@plc-user — you're right that schematics never had scale and shouldn't get it now. Nobody here has actually proposed that, including the Phase 0 plan above, which was explicit: scale is per-folio and opt-in, and "make schematic folios true scale" was listed as a non-goal from the start. If that scoping wasn't clear, it should have been — a lot of the pushback reads like it's aimed at "QET becomes a scaled CAD tool," which isn't what's on the table. Your schematic workflow keeps its current freedom regardless of how this lands. The actual disagreement: does a panel-layout folio need enforced scale, or is a printed ruler enough?Your screenshot of printing @IBSYSLevi's layout on any paper size and reading dimensions off it is real evidence — for the casual, manually-checked case. It shows the current ad hoc approach isn't broken for a one-off drawing someone reads visually. I don't think that's in dispute. Where it doesn't hold: #723 already landed real The concrete evidence: QET's own export pipeline already breaks the "ruler is enough" assumptionI checked this in the code, not by argument. Why I think this belongs in QET rather than staying manualNot because "real CAD tools do it" on its own — because the alternative doesn't remove the work, it just moves it onto the user, silently, on every placement, forever, with no way to notice a mistake. A folio where scale is explicit and enforced makes it structurally impossible to place a component at the wrong apparent size; a ruler-only approach makes it possible to get wrong and invisible when you do. That's the actual ease-of-use argument, not "professional tools have this feature" — the version of easy-to-use that holds up under real use is the one where correctness doesn't depend on the user remembering to check. Net
@scorpio810 — given the scope above doesn't touch schematics at all, is opt-in per-folio scale something you'd want, or is there a reason to hold off even at that narrower scope? |
|
I’m actually not so sure anymore that a mm measurement on the pages is really necessary. I still believe that the difference between mm and px on the ruler doesn’t affect the design flexibility, but it’s definitely helpful for control cabinet layout. What confuses me most is converting mm to px. To work around this, I added length and width as properties to the rectangle in the standard editor. (See #749) But you should be able to use this to draw the control cabinet with the correct width-to-height ratio and set the scale of the layout sheet based on that. By the way, have you taken a look at this feature yet, or perhaps tested it?
I think it already offers some cool added value, even if it's not quite finished yet. |
|
https://qelectrotech.org/forum/viewtopic.php?pid=20310#p20310 Just use defined rules and change folio dimensions. |
|
Gustavo @ Industrialismo use another tools for cabinet: |
|
Kellermorph use Qcad https://qelectrotech.org/forum/viewtopic.php?pid=22923#p22923 |
|
Thanks for the inputs @scorpio810. I see that the described workflow generally works with second elements created separately in each case. I also see that it’s possible to create an SGK layout using another application or external tools. But I also see something else: Since the information needed for this is already largely available in QET, I see an advantage in being able to create such a layout directly in QET. This would eliminate the need to maintain the relevant information or symbols in a second or third software program. It would also make it easier and more consistent to implement changes later on. The ongoing maintenance of two elements per component also represents additional manual effort. The same applies to the manual assembly, labeling and positioning of a layout. Especially for larger projects, I see potential here to reduce repetitive tasks through automation. For me, this is therefore less a question of whether the existing workflow works—it does—and more a question of which part of the control cabinet engineering QET should handle itself and which manual steps could be replaced by automation. If QET’s philosophy is to essentially limit itself to creating circuit diagrams and to handle further steps—such as control cabinet/SGK layouts or schematic diagrams—using external tools or manual workflows, that would also be a legitimate decision in my view. In that case, a clear statement regarding this distinction would be helpful. My view is simply that, thanks to its existing database, QET would be well-positioned to automate such recurring tasks directly. Especially when, for example, BMKs are generated, they would not need to be maintained manually in multiple places but could be automatically imported and updated accordingly when changes are made. Component maintenance could also be limited to a single element, rather than having to maintain separate variants of the same component for different representations. |
|
Interestingly, the column widths in PLC Manager are specified in mm, which also results in some interesting table widths... |
|
You're right, and it's worse than a labelling quirk — I went looking and there is no conversion behind those fields at all.
m_plc_row_height_spinbox->setSuffix(tr(" mm")); // min 4, max 30, default 8
...
sb->setSuffix(tr(" mm")); // column widths: min 10, max 500, default 40Those values go into case 0: col_widths[col] = 35; break; // Type
case 1: col_widths[col] = 25; break; // Address
case 2: col_widths[col] = 50; break; // FunctionThere is no The part I find most relevant to this thread: the cabinet layout already solves this properly, and does it the way the rest of QET doesn't. In auto *cabinet_layout_mm_sb = new QDoubleSpinBox(cabinet_layout_infos);
cabinet_layout_mm_sb->setSuffix(tr(" mm"));
...
auto *cabinet_layout_scale_row = ...i.e. the user states "this many mm corresponds to this many drawing units", and everything downstream is honest about it. That works precisely because it doesn't assume a global mapping — it makes the user supply one. So there are currently three different treatments of physical units in the codebase: an explicit user-defined scale (cabinet layout), a suffix with no conversion behind it (PLC table), and no notion of physical size at all (everything else). That seems like a reasonable argument for the folio paper size this thread is about: it would give the one thing all three are missing — a project-level statement of what a drawing unit is worth in mm — and the PLC fields could then mean what their suffix already claims. The mislabelled suffix is arguably a small bug worth fixing on its own regardless, but fixing it needs the same missing mapping. |
|
I have a first working draft of the layout function, including the feature suggested by @plc-user; the reuse of the “Front View,” which can now be specified as a layout reference on the component and, once saved as an SVG, can also be inserted into the layout. Insertion as an original component is planned but not yet implemented. I’m concerned that there might be a conflict with the BMK references and the BMKs already existing on the “Front View.” Anyway, I’d appreciate some feedback on whether this is worth a pull request. To be honest, it still needs some testing ;) |







Uh oh!
There was an error while loading. Please reload this page.
Give folios a named real-world paper size, as the base for true-to-scale printing and the cabinet-layout scale field
Spun out of #723 / #410 at IBSYSLevi's suggestion — the gap below affects every folio, not just the disposition/cabinet-layout feature, so it seemed worth its own discussion rather than deciding it inside that PR thread.
The gap
A QET folio has no named page size (A4, A3, …) in mm. What exists today is a pixel extent, and export sizes that pixel extent directly:
So there's a fixed, working px↔mm relationship (1 px = 25.4/96 ≈ 0.2646 mm — I checked: a blank folio exports as 339.0 × 229.3 mm from a 1281 × 867 px extent), but nothing that says "this folio is an A4 sheet." Two consequences fall out of that:
1. GUI print doesn't preserve scale at all.
ProjectPrintWindow::printDiagram()renders withQt::KeepAspectRatio, fitting the content to the printer's page rect:That's fit-to-page, not true-to-scale — a drawing that's "1:10" prints at whatever scale fills the paper, not literally 1:10. CLI PDF export doesn't have this problem (fixed 96 dpi mapping, no fit-to-page step), so the two export paths currently disagree on physical scale.
2. It's why the cabinet-layout scale field is a stopgap. IBSYSLevi's disposition-view scale is currently entered as "X px for Y mm" — which only has to exist as a raw px:mm ratio because the page itself was never given a real size. Once a folio has a named paper size, that field becomes a proper ratio (e.g. 1:10) instead.
Possibly the same root cause as a rendering bug, too. rsoliveir reported borderless printing crops the bottom-right corner of the title block, and traced it to the same area — the fit-to-page calc may be using
paperRect()(full paper) instead ofpageRect()(actual printable area), silently ignoring the printer's hardware margin. Worth confirming together with whatever changes here, since it's the same code path.Proposal (IBSYSLevi's, restated for discussion)
Related, and worth deciding alongside this
dxf2elmtuses for DXF imports). plc-user argued this should stay a fixed convention for the official collection rather than user-editable per element, specifically so the collection doesn't end up with mismatched scales across contributors. That's a separate axis from the folio's own paper size, but the two need to agree with each other for the disposition view's ratio to mean anything.Open questions
All reactions