| Numéro d’ID de bogue |
BUG-000106176 |
| Envoi | June 28, 2017 |
| Dernière modification | June 5, 2024 |
| S’applique à | ArcGIS CityEngine |
| Version trouvée | 2016.1 |
| Statut | Non-Reproducible
Ce problème n’a pas pu être reproduit au cours des tests réalisés par l’équipe de développement. Ce statut peut être attribué aux problèmes qui sont impossibles à reproduire ou qui ne sont plus d’actualité dans une version de développement du logiciel, alors qu’aucun correctif spécifique n’a été installé pour résoudre le problème. Pour d’autres explications, reportez-vous à la section Informations supplémentaires correspondant au problème.
|
Informations supplémentaires
When moving a node in python it is not expected, that it snaps to a neighboring node.
When snapping is desired, please use the following commands:
graphlayer = ce.getObjectsFrom(ce.scene(),ce.withName("Streetnetwork"),ce.isLayer)[0]
cleanupSettings = CleanupGraphSettings()
cleanupSettings.setSnapNodesToSegments(True)
cleanupSettings.setSnappingDist(20)
ce.cleanupGraph(graphlayer,cleanupSettings)
Known limitation: This is applied to the whole Streetnetwork.
To overcome this, I once made as script, that only merges nodes in a selectionfrom scripting import *
# get a CityEngine instance
ce = CE()
def getAdjacentSegments(nodes):
segments = []
for n in nodes:
seg = ce.getObjectsFrom(n, ce.isGraphSegment)
for s in seg:
if (s not in segments):
segments.append(s)
return segments
def getCleanupGraphSettings(default = True, dist = 10):
cleanupSettings = CleanupGraphSettings()
cleanupSettings.setIntersectSegments(default)
cleanupSettings.setMergeNodes(default)
cleanupSettings.setMergingDist(dist)
cleanupSettings.setSnapNodesToSegments(default)
cleanupSettings.setSnappingDist(10)
cleanupSettings.setResolveConflictShapes(default)
return cleanupSettings
def mergeNodes(segments):
# get graph layer and create tmp layer
graphLayer = ce.getLayer(segments[0])
graphLayerTmp = ce.addGraphLayer('tmp_streets')
# do merging of segments in tmp layer
ce.copy ( ce.getObjectsFrom(ce.selection), True, graphLayerTmp )
cleanupSettings = getCleanupGraphSettings(False)
cleanupSettings.setMergeNodes(True)
ce.cleanupGraph(graphLayerTmp, cleanupSettings)
result = ce.copy (ce.getObjectsFrom(graphLayerTmp), True, graphLayer)
# integrate merged segments back into graph
cleanupSettings = getCleanupGraphSettings(False)
cleanupSettings.setSnapNodesToSegments(True)
cleanupSettings.setSnappingDist(0)
ce.cleanupGraph(graphLayer, cleanupSettings)
# cleanup
ce.delete(graphLayerTmp)
if __name__ == '__main__':
nodes = ce.getObjectsFrom(ce.selection, ce.isGraphNode)
segments = getAdjacentSegments(nodes)
mergeNodes(segments):
Étapes pour reproduire
ID de bogue: BUG-000106176
Logiciel: