Version 1 (modified by 5 years ago) (diff) | ,
---|
SALOME SHAPER
SALOME je odprtokodno okolje, ki vsebuje več integriranih modulov, ter je namenjeno reševanju kompleksnih numeričnih problemov ter izvajanju simulacij. Ti numerični problemi bazirajo na začetnem CAD modelu. SALOME vsebuje tudi orodja, ki omogočajo delo s CAD modeli oz. z značilkami CAD modelov ter tako spremembo CAD modelov (poenostavitev) in pridobitev različnih podatkov iz CAD modelov.
Povezave:
- Predstavitev SHAPER modula
- SHAPER dokumentacija
- SHAPER primeri na Youtube
- SHAPER interaktivni tutorial
Predstavitev SHAPER modula na primerih
Primer 1: Postopek preprostega izvleka v prostor (Extrude)
V SALOME Python shell vnesemo naslednje ukaze:
# Uvozimo potrebne knjižnice from salome.shaper import model # Inicializiramo model model.begin() mypartset = model.moduleDocument() # Dodamo novi part mypart = model.addPart(mypartset).document() # Naredimo skico, ki predstavlja osnovo za naš izvlek v prostor sketch_base = model.addSketch(mypart, model.defaultPlane("XOY")) # - Določimo štiri linije l1 = sketch_base.addLine(0, 0, 0, 50) # Linijo, ki leži v trenutni ravnini, se definira z dvema točkama na način (x1,y1, x2, y2) l2 = sketch_base.addLine(0, 50, 50, 50) l3 = sketch_base.addLine(50, 50, 50, 0) l4 = sketch_base.addLine(50, 0, 0, 0) # Prikaži dopolnjen model model.do() # Izvlek v prostor mybox = model.addExtrusion(mypart, sketch_base.selectFace(), 50) # Prikaži dopolnjen model model.do.()
Primer 2: Postopek izvleka v prostor z uporabo relacij
Ta primer je podoben primeru 1 z razliko da se bo uporabilo relacije med elementi (sovpadanje točk, vzporednost ipd.).
V SALOME Python shell vnesemo naslednje ukaze:
# Uvozimo potrebne knjižnice from salome.shaper import model # Inicializiramo model model.begin() mypartset = model.moduleDocument() # Dodamo novi part mypart = model.addPart(mypartset).document() # Naredimo skico, ki predstavlja osnovo za naš izvlek v prostor # V tem primeru bomo naredili "neustrezno" skico, v kateri nam linije ne bodo sovpadale. To se bo kasneje uredilo z relacijami sketch_base = model.addSketch(mypart, model.defaultPlane("XOY")) # - Določimo štiri linije v ravnini l1 = sketch_base.addLine(0, 0, 0, 50) l2 = sketch_base.addLine(0, 123, 50, 50) # neustrezna linija l3 = sketch_base.addLine(50, 50, 50, 0) l4 = sketch_base.addLine(50, 0, 123, 123) # neustrezna linija model.do() # Določevanje relacij med linijami v skici: # - fiksna pozicija točk linij. Linija l1 in l3 so v redu zato jih določimo kot fiksne sketch_base.setFixed(l1.startPoint()) sketch_base.setFixed(l1.endPoint()) sketch_base.setFixed(l3.startPoint()) sketch_base.setFixed(l3.endPoint()) # - stikanje koncev linij sketch_base.setCoincident(l1.endPoint(), l2.startPoint()) sketch_base.setCoincident(l2.endPoint(), l3.startPoint()) sketch_base.setCoincident(l3.endPoint(), l4.startPoint()) sketch_base.setCoincident(l4.endPoint(), l1.startPoint()) # Prikaži dopolnjen model model.do() # Izvlek v prostor mybox = model.addExtrusion(mypart, sketch_base.selectFace(), 50) # Prikaži dopolnjen model model.do()
Namesto sikanja koncev točk linij se lahko ureja druge relacije ter lastnosti. Pri tem je treba paziti, da se skico ne predefinira!
Spodaj je prikaz, kako se lahko določi druge relacije.
# - vzporednost sketch_base.setParallel(l1, l3) sketch_base.setParallel(l2, l4) # - pravokotnost sketch_base.setPerpendicular(l1, l4) - vertikalnost sketch_base.setVertical(l1) # - fiksna pozicija točk linij sketch_base.setFixed(l1.startPoint()) # Določitev širine linije mywidth = sketch_base.setLength(l1, 50) # Določitev dolžine skice mylength = sketch_base.setDistance(l1.startPoint(), l3.endPoint(), 50)
Attachments (25)
-
test.step (19.3 KB) - added by 5 years ago.
Test STEP file used in the examples.
-
shaper_example_addBox_PythonShell.png (30.7 KB) - added by 5 years ago.
SHAPER addBox example: code entry in python shell.
-
shaper_example_addBox_result.png (5.5 KB) - added by 5 years ago.
SHAPER addBox result.
-
shaper_example_addBox_objectBrowser.png (15.1 KB) - added by 5 years ago.
SHAPER addBox example object browser at finish.
-
SALOME_SHAPER_empty_case.png (84.5 KB) - added by 5 years ago.
Updated again.
-
SHAPER_primitives_addPoint.png (5.6 KB) - added by 5 years ago.
Primitives: addPoint.
-
SHAPER_primitives_addBox.png (8.1 KB) - added by 5 years ago.
Primitives: addBox.
-
SHAPER_primitives_addCone.png (43.0 KB) - added by 5 years ago.
Primitives: addCone.
-
SHAPER_primitives_addTorus.png (62.7 KB) - added by 5 years ago.
Primitives: addTorus
-
SHAPER_primitives_addSphere.png (50.0 KB) - added by 5 years ago.
Primitives: addSphere.
-
SHAPER_primitives_addCylinder.png (10.2 KB) - added by 5 years ago.
Primitives: addCylinder.
-
SHAPER_example_extrude_1.png (7.5 KB) - added by 5 years ago.
SHAPER: extrude example1.
-
SHAPER_example_extrude_2.png (6.1 KB) - added by 5 years ago.
SHAPER: extrude example 2.
-
SHAPER_example_box_50x50.png (7.8 KB) - added by 5 years ago.
Better image.
-
SHAPER_example_3D_polyline.png (9.2 KB) - added by 5 years ago.
SHAPER: 3D polyline.
- SHAPER_UI_mouse_interaction_style_button.png (733 bytes) - added by 5 years ago.
- SHAPER_UI_fit_all_button.png (801 bytes) - added by 5 years ago.
- SHAPER_UI_3D_view_operations_buttons.png (800 bytes) - added by 5 years ago.
- SHAPER_UI_reset_view_button.png (1.0 KB) - added by 5 years ago.
-
SHAPER_example_cut.png (35.7 KB) - added by 5 years ago.
Result of example describing boolean cut method with Shaper module.
-
SHAPER_example_common.png (31.7 KB) - added by 5 years ago.
Image for SHAPER addCommon example.
-
SHAPER_example_fuse.png (24.2 KB) - added by 5 years ago.
Image for addFuse example.
-
SHAPER_example_makeFillet.png (58.5 KB) - added by 5 years ago.
Image showing the result of makeFillet.py example.
-
SHAPER_example_makeFillet_Z_aligned_edges.png (9.4 KB) - added by 5 years ago.
Image showing the result of makeFillet_Z_aligned_edges.py example.
-
SHAPER_STEP_import_with_QFileDialog.png (83.1 KB) - added by 5 years ago.
Image for SHAPER PyQt5 QFileDialog example for importing STEP file.
Download all attachments as: .zip