Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Oct 10, 2024
1 parent 85d4ceb commit fbaa8cd
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 381 deletions.
6 changes: 4 additions & 2 deletions nodes/3.x/CardinalDirectionFromAngle.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "# Based on https://gist.github.com/RobertSudwarts/acf8df23a16afdb5837f#gistcomment-3070256\r\n\r\ndirs = []\r\ndirs.append(['N', 'E', 'S', 'W'])\r\ndirs.append(['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'])\r\ndirs.append(['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'])\r\n\r\ndef GetCardinalDirection(angle):\r\n\tif angle:\r\n\t\tix = round(angle / (360. / len(cdirs)))\r\n\t\treturn cdirs[int(ix % len(cdirs))]\r\n\telif angle == 0: return 'N'\r\n\telse: return None\r\n\r\nif IN[1] not in (0, 1, 2): IN[1] = 0\r\ncdirs = dirs[IN[1]]\r\nif isinstance(IN[0], list): OUT = [GetCardinalDirection(x) for x in IN[0]]\r\nelse: OUT = GetCardinalDirection(IN[0])",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "589f9095ef97482085d764679742021d",
"Inputs": [
Expand Down Expand Up @@ -143,18 +144,19 @@
],
"Dependencies": [],
"NodeLibraryDependencies": [],
"Author": "None provided",
"Bindings": [],
"View": {
"Dynamo": {
"ScaleFactor": 1.0,
"HasRunWithoutCrash": false,
"IsVisibleInDynamoLibrary": true,
"Version": "2.3.1.11775",
"Version": "2.12.1.8246",
"RunType": "Manual",
"RunPeriod": "1000"
},
"Camera": {
"Name": "Background Preview",
"Name": "Hintergrundvorschau",
"EyeX": -17.0,
"EyeY": 24.0,
"EyeZ": 50.0,
Expand Down
Loading

0 comments on commit fbaa8cd

Please sign in to comment.