def open_node_data(self):
# options = QFileDialog.Options()
files, _ = QFileDialog.getOpenFileNames(self, "Select Files", "", "All Files (*);;Text Files (*.txt)")
if len(files) == 2:
self.points, self.uPoints, self.heatmaps = read_Nodes(files[0] if "Node" in files[0] else files[1])
self.cells = read_Triangles(files[0] if "Element" in files[0] else files[1])
num_hex = len(self.cells) // 6
for i in range(num_hex):
hex_faces = self.cells[i * 6:(i + 1) * 6]
self.create_mesh(self.points, hex_faces, color=[0.31, 0.51, 0.9], bounding=False)
< /code>
Lesen Sie alle Punkte und Gesichter des Hexaheders, [url=viewtopic.php?t=13628]teilen[/url] Sie sie in unabhängige Polydaten auf, speichern Sie sie im Schauspieler und fügen Sie sie dann zu vtkassmbly hinzu. Der Zweck davon ist nur, auf die einzelnen Hexaeder -Einheiten zu klicken, wenn die Maus ausgewählt wird, und auf sie zu arbeiten, aber die Interaktion ist zu umständlich < /p>
def create_mesh(self, points, cells, color, bounding=False, num=0):
points_vtk = vtk.vtkPoints()
for point in points:
points_vtk.InsertNextPoint(point)
cells_vtk = vtk.vtkCellArray()
for cell in cells:
cells_vtk.InsertNextCell(4, cell[1:])
polydata = vtk.vtkPolyData()
polydata.SetPoints(points_vtk)
polydata.SetPolys(cells_vtk)
featureEdges = vtk.vtkFeatureEdges()
featureEdges.SetInputData(polydata)
featureEdges.BoundaryEdgesOn()
featureEdges.Update()
boundary = featureEdges.GetOutput()
points_list = []
for i in range(boundary.GetNumberOfPoints()):
p = boundary.GetPoint(i)
points_list.append(p)
pointColors = vtk.vtkUnsignedCharArray()
pointColors.SetNumberOfComponents(3)
pointColors.SetName("PointColors")
numPts = polydata.GetNumberOfPoints()
for i in range(numPts):
pointColors.InsertNextTuple3(color[0]*255,color[1]*255,color[2]*255)
polydata.GetPointData().SetScalars(pointColors)
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(polydata)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetColor(color)
self.interactor_style.register_actor_polydata(actor, polydata)
self.assembly.AddPart(actor)
self.renderer.AddActor(self.assembly)
Was sollte die Rendering -Strategie sein? Vielleicht fahren tausend Schauspieler Zeit nach < /p> [code]def open_node_data(self): # options = QFileDialog.Options() files, _ = QFileDialog.getOpenFileNames(self, "Select Files", "", "All Files (*);;Text Files (*.txt)") if len(files) == 2: self.points, self.uPoints, self.heatmaps = read_Nodes(files[0] if "Node" in files[0] else files[1]) self.cells = read_Triangles(files[0] if "Element" in files[0] else files[1]) num_hex = len(self.cells) // 6 for i in range(num_hex): hex_faces = self.cells[i * 6:(i + 1) * 6] self.create_mesh(self.points, hex_faces, color=[0.31, 0.51, 0.9], bounding=False) < /code> Lesen Sie alle Punkte und Gesichter des Hexaheders, [url=viewtopic.php?t=13628]teilen[/url] Sie sie in unabhängige Polydaten auf, speichern Sie sie im Schauspieler und fügen Sie sie dann zu vtkassmbly hinzu. Der Zweck davon ist nur, auf die einzelnen Hexaeder -Einheiten zu klicken, wenn die Maus ausgewählt wird, und auf sie zu arbeiten, aber die Interaktion ist zu umständlich < /p> def create_mesh(self, points, cells, color, bounding=False, num=0): points_vtk = vtk.vtkPoints() for point in points: points_vtk.InsertNextPoint(point)
cells_vtk = vtk.vtkCellArray() for cell in cells: cells_vtk.InsertNextCell(4, cell[1:])
points_list = [] for i in range(boundary.GetNumberOfPoints()): p = boundary.GetPoint(i) points_list.append(p)
pointColors = vtk.vtkUnsignedCharArray() pointColors.SetNumberOfComponents(3) pointColors.SetName("PointColors") numPts = polydata.GetNumberOfPoints() for i in range(numPts): pointColors.InsertNextTuple3(color[0]*255,color[1]*255,color[2]*255) polydata.GetPointData().SetScalars(pointColors)
mapper = vtk.vtkPolyDataMapper() mapper.SetInputData(polydata) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetColor(color) self.interactor_style.register_actor_polydata(actor, polydata) self.assembly.AddPart(actor) self.renderer.AddActor(self.assembly) [/code] Ich weiß nicht, was zu tun ist.
.NET MAUI Um HTML -Inhalte in einem Etikett auf iOS und Android zu rendern, verwende ich das Attribut textType = html im Labelelement. IOS rendert jedoch keine HTML, während Android nur mutigen Text...
Ich versuche, C ++ 23 zu lernen, und dachte Die Anzahl der Argumente entspricht der Anzahl der Platzhalter (hier nur % für den Einfachheit halber) in der Formatzeichenfolge und erstellt und gibt dann...
Ich bin neu auf GEM5. ist, die Anzahl der Anweisungen und Zyklen zu erhalten, die ein Teil dieses Programms (ein Bubble -Sortiercode) zum Ausführen benötigt. Parameter, aber diese Datei bezieht sich...