visualdynamics.gui.mesh_panel¶
mesh_panel
¶
The pane beside the 3-D view where the solids are typed.
A solid is described by its center and its size, and its preview in the view is turned and slid by the same gizmo that turns a coordinate system. So the pane holds a center and the solid's dimensions in the display unit, and the window holds the frame the solid is drawn in: the rings turn it about its center, and the arrows slide the center along the frame's own axes onto the grid. The rotation is also three fields, degrees about the geometry's X, Y and Z applied in that order, for an angle the rings' whole degrees do not reach. The rings write the angles back, so the fields and the view always agree. Square Up turns the solid back to the geometry's axes and keeps its center.
The pane holds no rule of its own. The window turns the fields and its
frame into the numbers the project's add_solid_* verbs take, asks the
core what they would make, and draws it. Add runs the project verb, so
the journal line is the call a script makes. A solid is a shape that is
meshed later (core.solids), so it has a name and no element size.
- A block is a center, three widths, three angles and a corner radius, which rounds its four edges along its own Z.
- A cylinder is a center, a radius, a length along the frame's Z, and three angles.
- A section is a shape (I-beam, channel, tee, angle, rectangular tube or
round tube), its dimensions, named as
core.solids.SECTIONSnames them, and a length along the frame's Z. - A hole is a diameter, a depth or Through, and a counterbore's diameter and depth when one is asked for. Its center is where it enters, and it runs down the frame's Z.
- A plate is a center, two widths in the frame's X-Y plane and three angles, and a disk a center, a radius and three angles. Neither has a thickness: they are meshed into shells, whose element group takes it.
A solid already made can be opened in the pane to change it, with Apply in place of Add. A boolean has no size of its own, so its pane (Move Part) only moves and turns it.
Classes:
| Name | Description |
|---|---|
MeshPanel |
The fields for one solid, and its Add (or Apply) button. |
Classes¶
MeshPanel
¶
Bases: QWidget
The fields for one solid, and its Add (or Apply) button.
changed is emitted when a field is edited; the window then reads
values and redraws the preview. add_asked, close_asked and
square_asked are the Add, Close and Square Up buttons.
Methods:
| Name | Description |
|---|---|
open_for |
Set the pane up for |
values |
The fields as typed, in the display unit, as a dict: 'center', |
set_values |
Fill fields by name, in the display unit: center=(x, y, z), |
show_reading |
Show what Add would make, as the window reads it from the core, |
Source code in src/visualdynamics/gui/mesh_panel.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | |
Methods:¶
open_for
¶
Set the pane up for kind, with every field on its default.
kind is 'solid_block', 'solid_cylinder', 'solid_cone',
'solid_sphere', 'solid_section', 'solid_hole', 'solid_plate' or
'solid_disk', or 'solid_part' for a boolean, which is only
edited. unit is the display unit the fields are in. The name
field opens empty, and only the fields the kind takes are shown.
editing opens the pane on a solid already made, to change it,
with Apply in place of Add; a section's shape cannot be changed
then.
Source code in src/visualdynamics/gui/mesh_panel.py
values
¶
The fields as typed, in the display unit, as a dict: 'center', 'widths', 'shape', 'dimensions', 'radius', 'length', 'corner', 'top', 'angles' in degrees and 'group', the solid's name.
A cone's 'radius' is at its base, 'top' at its top and 'length'
its height. A section's 'dimensions' are its shape's, in the order
SECTIONS gives them. A hole's are its diameter, its depth (zero when it
goes through) and its counterbore's diameter and depth (zeros
when it has none), as edit_solid takes them. For a cylinder, a
section and a hole, 'widths' is the size of the box around the
solid, which the gizmo is sized by.
Source code in src/visualdynamics/gui/mesh_panel.py
set_values
¶
Fill fields by name, in the display unit: center=(x, y, z),
widths=(x, y, z), angles=(x, y, z) in degrees, radius, length,
corner, top, shape, dimensions and group. A hole's
dimensions are given as values gives them. Picking a shape
opens its dimensions on that shape's defaults, except when
editing.
Tests type with this, and the gizmo writes the center and the
angles back with it. With quiet the fields are filled without
emitting changed.
Source code in src/visualdynamics/gui/mesh_panel.py
show_reading
¶
Show what Add would make, as the window reads it from the core,
and enable Add only when ok.