pyg4ometry.convert¶
Submodules¶
- pyg4ometry.convert.fluka2Geant4
- pyg4ometry.convert.fluka2g4materials
- pyg4ometry.convert.freecad2Fluka
- pyg4ometry.convert.gdml2stl
- pyg4ometry.convert.geant42Fluka
- pyg4ometry.convert.geant42FlukaBake
- pyg4ometry.convert.geant42Geant4
- pyg4ometry.convert.geant42Vtk
- pyg4ometry.convert.oce2Geant4
- pyg4ometry.convert.stl2gdml
- pyg4ometry.convert.vis2oce
Attributes¶
Classes¶
Rectangular Parallelepiped |
|
General Rectangular Parallelepiped |
|
Sphere |
|
Right Circular Cylinder |
|
Right Elliptical Cylinder |
|
Truncated Right-angled Cone |
|
Ellipsoid of Revolution |
|
Right Angle Wedge |
|
Base class representing a body as defined in FLUKA |
|
Arbitrary Convex Polyhedron |
|
Infinite half-space delimited by the x-y plane (perpendicular to the z-axis) |
|
Infinite half-space delimited by the x-y plane (perpendicular to the y-axis) |
|
Infinite half-space delimited by the x-y plane (perpendicular to the x-axis) |
|
Infinite half-space delimited by the x-y plane (perpendicular to the z-axis) Generic infinite half-space. |
|
Infinite Circular Cylinder parallel to the x-axis |
|
Infinite Circular Cylinder parallel to the y-axis |
|
Infinite Circular Cylinder parallel to the z-axis |
|
Infinite Elliptical Cylinder parallel to the x-axis |
|
Infinite Elliptical Cylinder parallel to the y-axis |
|
Infinite Elliptical Cylinder parallel to the z-axis |
|
Generic quadric |
Functions¶
|
Convert a FLUKA registry to a Geant4 Registry. |
|
|
|
Convert a Geant4 model to a FLUKA one. This is done by handing over a complete |
|
Convert a single logical volume - not the main entry point for the conversion. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make a logical volume from input or get from registry |
|
Make a assembly volume from input or get from registry |
|
Make a tessellated solid from a OpenCascade shape |
|
|
|
Convert CAD geometry starting from shapeName |
|
Package Contents¶
- pyg4ometry.convert.fluka2Geant4(flukareg, regions=None, omitRegions=None, worldMaterial='G4_Galactic', worldDimensions=None, omitBlackholeRegions=True, quadricRegionAABBs=None, **kwargs)¶
Convert a FLUKA registry to a Geant4 Registry.
- Parameters:
flukareg (FlukaRegistry) – FlukaRegistry instance to be converted.
regions (list) – Names of regions to be converted, by default all are converted. Mutually exclusive with omitRegions.
omitRegions (list) – Names of regions to be omitted from the conversion. This option is mutually exclusive with the kwarg regions.
worldMaterial (string) – name of world material to be used.
worldDimensions (list) – dimensions of world logical volume in converted Geant4. By default this is equal to WORLD_DIMENSIONS.
omitBlackholeRegions (bool) – whether or not to omit regions with the FLUKA material BLCKHOLE from the conversion. By default, true.
quadricRegionAABBs (dict) – The axis-aligned aabbs of any regions featuring QUA bodies, mapping region names to fluka.AABB instances.
Developer options (to kwargs) withLengthSafety: Whether or not to apply automatic length safety.
minimiseSolids: Whether or not to minimise the boxes and tubes of Geant4 used to represent infinite solids in FLUKA.
- class pyg4ometry.convert._PolygonProcessing¶
- classmethod windingNumber(pgon)¶
return the winding number of pgon :param pgon: list of points [[x1,y1], [x2,y2], … ] :type pgon: List[List[x1,y1], …] returns: Integer winding number
- classmethod reversePolygon(pgon)¶
return reversed polygon :param pgon: list of points [[x1,y1], [x2,y2], … ] :type pgon: List[List[x1,y1], …] returns: List[List[x1,y1], …]
- classmethod makePolygonFromList(pgon, type='')¶
Convert list of points [[x1,y1], [x2,y2], … ] to cgal Polygon_2
- Parameters:
pgon (List[List[x,y], ..]) – list of points [[x1,y1], [x2,y2], … ]
type – Class of polygon (Polygon_2_EPICK, Polygon_2_EPECK, Partition_traits_2_Polygon_2_EPECK)
type – str
returns: Polygon_2
- classmethod makeListFromPolygon(pgon)¶
Convert 2D polygon to list of points [[x1,y1], [x2,y2], … ]
- Parameters:
pgon (Polygon_2_EPECK or Polygon_2_EPICK) – cgal Polygon_2 input
returns: [[x1,y1], [x2,y2], …]
- classmethod decomposePolygon2d(pgon)¶
Decompose general 2D polygon (pgon) to convex 2D polygons
- Parameters:
pgon (List(List[2])) – list of pgon points (which are lists) [[x1,y1], [x2,y2], …]
returns: List of polgons [pgon1, pgon2, …]
- classmethod decomposePolygon2dWithHoles(pgonOuter, pgonHoles)¶
Decompose general 2D polygon with holes (pgon) to convex 2D polygons
- Parameters:
pgonOuter – list of pgon points (which are lists) [[x1,y1], [x2,y2], …]
pgonHoles – List of polgons [pgon1, pgon2, …]
returns: List of polgons [pgon1, pgon2, …]
- classmethod triangulatePolygon2d(pgon)¶
Triangulate general 2D polygon
- Parameters:
pgonOuter – list of pgon points (which are lists) [[x1,y1], [x2,y2], …]
returns: List of triangles [ [[x1,y1], [x2,y2], [x3,y3]], [[x1,y1], [x2,y2], [x3,y3]], …]
- pyg4ometry.convert._rotoTranslationFromTra2(name, tra2, flukaregistry=None, allowZero=False)¶
- pyg4ometry.convert.geant4Reg2FlukaReg(greg, logicalVolumeName='', bakeTransforms=False)¶
Convert a Geant4 model to a FLUKA one. This is done by handing over a complete pyg4ometry.geant4.Registry instance.
- Parameters:
greg (pyg4ometry.geant4.Registry) – geant4 registry
returns: pyg4ometry.fluka.FlukaRegistry
- pyg4ometry.convert.geant4Logical2Fluka(logicalVolume, flukaRegistry=None, bakeTransforms=False)¶
Convert a single logical volume - not the main entry point for the conversion.
- pyg4ometry.convert.geant4PhysicalVolume2Fluka(physicalVolume, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, flukaNameCount=0, bakeTransforms=False)¶
- pyg4ometry.convert.geant4Solid2FlukaRegion(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransforms=False)¶
- pyg4ometry.convert.geant4MaterialDict2Fluka(matr, freg)¶
- pyg4ometry.convert.geant4Material2Fluka(material, freg, suggestedDensity=None, elementSuffix=False, materialNameShort=None)¶
- pyg4ometry.convert.geant4Box2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Tubs2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4CutTubs2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Cons2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.pycsgmesh2FlukaRegion(mesh, name, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Sphere2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Orb2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Torus2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Polycone2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Extruded2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Polyhedra2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4EllipticalTube2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Ellipsoid2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4EllipticalCone2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Paraboloid2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Hype2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4Tet2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.geant4GenericTrap2Fluka(flukaNameCount, solid, mtra=_np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), tra=_np.array([0, 0, 0]), flukaRegistry=None, addRegistry=True, commentName='', bakeTransform=False)¶
- pyg4ometry.convert.makeStripName(mn)¶
- pyg4ometry.convert.makeShortName(mn)¶
- pyg4ometry.convert.transformQuadricFluka(axx, ayy, azz, axy, axz, ayz, ax, ay, az, a, M, T)¶
- pyg4ometry.convert.transformQuadricMatrix(Q, P, R, M, T)¶
- class pyg4ometry.convert.RPP(name, xmin, xmax, ymin, ymax, zmin, zmax, transform=None, flukaregistry=None, addRegistry=True, comment='')¶
Bases:
BodyMixinRectangular Parallelepiped
- Parameters:
- name¶
- lower¶
- upper¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- lengths()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.BOX(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, addRegistry=True, comment='')¶
Bases:
BodyMixinGeneral Rectangular Parallelepiped
- Parameters:
- name¶
- vertex¶
- edge1¶
- edge2¶
- edge3¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- lengths()¶
- geant4Solid(greg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.SPH(name, point, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinSphere
- Parameters:
- name¶
- point¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.RCC(name, face, direction, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinRight Circular Cylinder
- Parameters:
- name¶
- face¶
- direction¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.REC(name, face, direction, semiminor, semimajor, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinRight Elliptical Cylinder
- Parameters:
- name¶
- face¶
- direction¶
- semiminor¶
- semimajor¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.TRC(name, major_centre, direction, major_radius, minor_radius, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinTruncated Right-angled Cone
- Parameters:
- name¶
- major_centre¶
- direction¶
- major_radius¶
- minor_radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(registry, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.ELL(name, focus1, focus2, length, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinEllipsoid of Revolution
- Parameters:
- name¶
- focus1¶
- focus2¶
- length¶
- transform¶
- comment¶
- semimajor¶
- centre(aabb=None)¶
- rotation()¶
- _linearEccentricity()¶
- _semiminor()¶
- geant4Solid(greg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.WED(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, comment='')¶
Bases:
_WED_RAWRight Angle Wedge
- class pyg4ometry.convert.RAW(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, comment='')¶
Bases:
_WED_RAWBase class representing a body as defined in FLUKA
- __doc__¶
- class pyg4ometry.convert.ARB(name, vertices, facenumbers, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinArbitrary Convex Polyhedron
- Parameters:
name (str) – of body
vertices (list) – Eight vertices which make up the polyhedron as [[x1, y1, z1], [x2, y2, z2], …]. There must be eight even if only six or seven vertices are needed to make up the polydedron.
facenumbers (float) – The faces of the polyhedron expressed as floats where each digit of the float refers to one of the vertices which makes up that face. Six must always be provided as [1234,8765, …], even if only four or five faces are needed. Any unneeded faces must be set to 0 (no less than 4 sides). Note that the references to the vertices are not zero-counting. The order of the vertices denoted in the facenumbers must be either all clockwise or all anticlockwise, which if not obeyed will result in erroneous output without warning.
- name¶
- vertices¶
- facenumbers¶
- transform¶
- comment¶
- _nfaces = 6¶
- zeros = []¶
- centre(aabb=None)¶
- rotation()¶
- _faceNumbersToZeroCountingIndices()¶
- _extent()¶
- geant4Solid(greg, aabb=None)¶
- _toTesselatedSolid(verticesAndPolygons, greg, addRegistry)¶
- _getVerticesAndPolygons()¶
- _toVerticesAndPolygons(reverse)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.XYP(name, z, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the z-axis)
- Parameters:
- name¶
- z¶
- transform¶
- comment¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.convert.XZP(name, y, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the y-axis)
- Parameters:
- name¶
- y¶
- transform¶
- comment¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.convert.YZP(name, x, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the x-axis)
- Parameters:
- name¶
- x¶
- transform¶
- comment¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.convert.PLA(name, normal, point, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the z-axis) Generic infinite half-space.
- Parameters:
- name¶
- normal¶
- point¶
- transform¶
- comment¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.convert.XCC(name, y, z, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
_InfiniteCylinderMixin,_ShiftableCylinderMixinInfinite Circular Cylinder parallel to the x-axis
- Parameters:
- name¶
- y¶
- z¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- point()¶
- direction()¶
- class pyg4ometry.convert.YCC(name, z, x, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
_InfiniteCylinderMixin,_ShiftableCylinderMixinInfinite Circular Cylinder parallel to the y-axis
- Parameters:
- name¶
- z¶
- x¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- point()¶
- direction()¶
- class pyg4ometry.convert.ZCC(name, x, y, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
_InfiniteCylinderMixin,_ShiftableCylinderMixinInfinite Circular Cylinder parallel to the z-axis
- Parameters:
- name¶
- x¶
- y¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- point()¶
- direction()¶
- class pyg4ometry.convert.XEC(name, y, z, ysemi, zsemi, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixin,_ShiftableCylinderMixinInfinite Elliptical Cylinder parallel to the x-axis
- Parameters:
- name¶
- y¶
- z¶
- ysemi¶
- zsemi¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.YEC(name, z, x, zsemi, xsemi, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixin,_ShiftableCylinderMixinInfinite Elliptical Cylinder parallel to the y-axis
- Parameters:
- name¶
- z¶
- x¶
- zsemi¶
- xsemi¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.ZEC(name, x, y, xsemi, ysemi, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixin,_ShiftableCylinderMixinInfinite Elliptical Cylinder parallel to the z-axis
- Parameters:
- name¶
- x¶
- y¶
- xsemi¶
- ysemi¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.convert.QUA(name, cxx, cyy, czz, cxy, cxz, cyz, cx, cy, cz, c, transform=None, flukaregistry=None, comment='', **kwargs)¶
Bases:
BodyMixinGeneric quadric
- Parameters:
name (str) – of body
cxx (float) – x^2 coefficient
cyy (float) – y^2 coefficient
czz (float) – z^2 coefficient
cxy (float) – xy coefficient
cxz (float) – xz coefficient
cyz (float) – yz coefficient
cx (float) – x coefficient
cy (float) – y coefficient
cz (float) – z coefficient
c (constant) – constant
- name¶
- cxx¶
- cyy¶
- czz¶
- cxy¶
- cxz¶
- cyz¶
- cx¶
- cy¶
- cz¶
- c¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- coefficientsMatrix()¶
- static _quadricMatrixToCoefficients(matrix)¶
- mesh(lower, upper, capping=True)¶
- geant4Solid(reg, aabb=None)¶
- _withLengthSafety(safety, reg=None)¶
- __repr__()¶
- flukaFreeString()¶
- hash()¶
- pyg4ometry.convert.freecadDoc2Fluka(fcd)¶
- pyg4ometry.convert.part2Region(obj, trfm, fgreg, meshDeviation=0.05)¶
- pyg4ometry.convert.stl2gdml(stlFileName, gdmlFileName='output.gdml', worldMaterial='G4_Galactic', solidMaterial='G4_Au')¶
- pyg4ometry.convert.geant4Solid2Geant4Tessellated(solid)¶
- pyg4ometry.convert.geant4Solid2Geant4Tessellated_NoVTK(solid)¶
- pyg4ometry.convert.gdml2stl(gdmlFileName, stlFileName='output.gdml', solidName='ws')¶
- pyg4ometry.convert.mkVtkIdList(it)¶
- pyg4ometry.convert.pycsgMeshToVtkPolyData(mesh)¶
- pyg4ometry.convert.vtkPolyDataToNumpy(data)¶
- pyg4ometry.convert.pycsgMeshToObj(mesh, fileName)¶
- pyg4ometry.convert.pyg42VtkTransformation(mtra, tra)¶
- pyg4ometry.convert.vtkTransformation2PyG4(vt)¶
- pyg4ometry.convert.pycsgMeshToStl(mesh, fileName)¶
- pyg4ometry.convert.defaultLinDef = 0.5¶
- pyg4ometry.convert.deftaulAngDef = 0.5¶
- pyg4ometry.convert.oceShape_Geant4_LogicalVolume(name, solid, material, greg)¶
Make a logical volume from input or get from registry
- Parameters:
name (str) – Name of logical volume
solid (SolidBase) – Geant4 solid
material (str or pyg4ometry.geant4.Material) – Material for logical volume
greg (geant4.Registry) – Geant4 registry
- pyg4ometry.convert.oceShape_Geant4_Assembly(name, greg)¶
Make a assembly volume from input or get from registry
- Parameters:
name (str) – Name of logical volume
greg (geant4.Registry) – Geant4 registry
- pyg4ometry.convert.oceShape_Geant4_Tessellated(name, shape, greg, linDef=0.5, angDef=0.5)¶
Make a tessellated solid from a OpenCascade shape
- Parameters:
name (str) – Name of logical volume
shape (TopoDS_Shape) – OpenCascade shape
greg (geant4.Registry) – Geant4 registry
- pyg4ometry.convert._oce2Geant4_traverse(shapeTool, label, greg, materialMap, labelToSkipList, meshQualityMap, badCADLabels, addBoundingSolids=False, oceName=False)¶
- pyg4ometry.convert.oce2Geant4(shapeTool, shapeName, materialMap={}, labelToSkipList=[], meshQualityMap={}, oceName=False)¶
Convert CAD geometry starting from shapeName
- Parameters:
shapeTool (pyoce.TopoDS_Shape) – OpenCascade TopoDS_Shape
shapeName (str) – Name of the shape in the CAD file
materialMap (dict) – dictionary to map shape name to material shapeName:materialName or shapeName:Material
meshQualityMap (dict) – dictionary to map shape name to meshing quality str:[LinDef,AngDef]
- pyg4ometry.convert.convertMeshToPolyTriangulation(m)¶
- pyg4ometry.convert.convertMeshToShapeUsingMakeShapeOnMesh(m)¶
- pyg4ometry.convert.convertMeshToShape(m)¶
- pyg4ometry.convert.vis2oce(vis, stepFileName='output.step')¶