{"id":21622538,"url":"https://github.com/cata77/data-transmission-formats","last_synced_at":"2026-05-17T13:04:55.780Z","repository":{"id":86028321,"uuid":"568382092","full_name":"Cata77/Data-Transmission-Formats","owner":"Cata77","description":"Data Transmission Formats Java Project","archived":false,"fork":false,"pushed_at":"2023-02-03T13:30:41.000Z","size":1447,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T18:58:29.897Z","etag":null,"topics":["html","java","json","json-parser","mathematics","stax-api","svg","xml"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cata77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-20T11:10:32.000Z","updated_at":"2023-08-21T09:20:18.000Z","dependencies_parsed_at":"2023-03-05T19:30:42.785Z","dependency_job_id":null,"html_url":"https://github.com/Cata77/Data-Transmission-Formats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cata77/Data-Transmission-Formats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cata77%2FData-Transmission-Formats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cata77%2FData-Transmission-Formats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cata77%2FData-Transmission-Formats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cata77%2FData-Transmission-Formats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cata77","download_url":"https://codeload.github.com/Cata77/Data-Transmission-Formats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cata77%2FData-Transmission-Formats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33139595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","java","json","json-parser","mathematics","stax-api","svg","xml"],"created_at":"2024-11-25T00:09:05.040Z","updated_at":"2026-05-17T13:04:55.767Z","avatar_url":"https://github.com/Cata77.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Transmission Formats Java Project\nUsers can search the internet for free 3D model data files of their interest (e.g. famous buildings). We would like to help them to view these model files\nmapped to 2D. The idea is that an application reads the 3D json file and converts it to SVG.\nSVG files can be viewed with a web browser\n\n## Functionaliy\n1. Application reads 3D model json file that contains triangles shapes.\n2. Application rotates the triangles, maps them to 2D and moves them to the visible portion of the screen.\n3. Write the triangles as polygons into an SVG file\n\n## Sample Input\nThe input can be found in the ```input``` folder.\n\nThis is a tetrahedron shape (formatting can be strange; reason is to fit on one page):\n\n```\n[\n  [\n    {\n      \"x\" : -100,\n      \"y\" : 100,\n      \"z\" : -100\n    },\n    {\n      \"x\" : 100,\n      \"y\" : 100,\n      \"z\" : -100\n    },\n    {\n      \"x\" : 0,\n      \"y\" : -100,\n      \"z\" : 0\n    }\n  ],\n  [\n    {\n      \"x\" : 100,\n      \"y\" : 100,\n      \"z\" : -100\n    },\n    {\n      \"x\" : 0,\n      \"y\" : 100,\n      \"z\" : 100\n    },\n    {\n      \"x\" : 0,\n      \"y\" : -100,\n      \"z\" : 0\n    }\n  ],\n  [\n    {\n      \"x\" : -100,\n      \"y\" : 100,\n      \"z\" : -100\n    },\n    {\n      \"x\" : 0,\n      \"y\" : 100,\n      \"z\" : 100\n    },\n    {\n      \"x\" : 0,\n      \"y\" : -100,\n      \"z\" : 0\n    }\n  ],\n  [\n    {\n      \"x\" : -100,\n      \"y\" : 100,\n      \"z\" : -100\n    },\n    {\n      \"x\" : 100,\n      \"y\" : 100,\n      \"z\" : -100\n    },\n    {\n      \"x\" : 0,\n      \"y\" : 100,\n      \"z\" : 100\n    }\n  ]\n]\n```\nThe tetrahedron rotation angles on each of the axles are (values are given in radian):   \n\n- X axis: -0.5\n\n- Y axis: 1\n\n- Z axis: 0.5\n\n## Sample Output \nThe output can be found in the ```output``` folder.\n\nThis is an output example:\n\n```html\n\u003c?xml\nversion=\"1.0\" ?\u003e\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003csvg width=\"1000\" height=\"1000\"\u003e\n      \u003cpolygon points=\"0.0,11.967310893242441 131.05818858679152,192.82522360138182 244.19152869049444,0.0\" style=\"fill:white;stroke:black;stroke-width:0.1\"\u003e\u003c/polygon\u003e\n      \u003cpolygon points=\"94.83197635580758,63.774255693227595 131.05818858679152,192.82522360138182\n244.19152869049444,0.0\" style=\"fill:white;stroke:black;stroke-width:0.1\"\u003e\u003c/polygon\u003e\n      \u003cpolygon points=\"0.0,11.967310893242441 94.83197635580758,63.774255693227595 244.19152869049444,0.0\" style=\"fill:white;stroke:black;stroke-width:0.1\"\u003e\u003c/polygon\u003e\n      \u003cpolygon points=\"0.0,11.967310893242441 94.83197635580758,63.774255693227595\n131.05818858679152,192.82522360138182\" style=\"fill:white;stroke:black;stroke-width:0.1\"\u003e\u003c/polygon\u003e\n    \u003c/svg\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nResult displayed on screen with a web browser:\n\n\u003cimg width=\"191\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216052242-fd9e7cff-a562-43fa-88f8-75e9a52ac6ae.png\"\u003e\n\n## Triangle Rotation\nRotate triangles by rotating their 3D points with this formula: rotation matrix * 3D point\n\n  1. Example for X axis rotation:\n    \n  \u003cimg width=\"365\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216052600-58810bff-ca04-4cfd-8ed3-5a39046e8b00.png\"\u003e\n  \n  2. Matrix multiplication: https://en.wikipedia.org/wiki/Matrix_multiplication\n\n### Rotation Matrices\n- X axis rotation matrix:\n\n\u003cimg width=\"280\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216053794-be42d417-d38d-4560-a7b2-7f944903c53c.png\"\u003e\n\n- Y axis rotation matrix:\n\n\u003cimg width=\"278\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216053918-6d4d7f87-e922-4032-b04e-7c79f8631eea.png\"\u003e\n\n- Z axis rotation matrix:\n\n\u003cimg width=\"286\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216054017-7c3b8cf8-35bd-4c44-abae-7199ec49a555.png\"\u003e\n\n\n### Rotation example\nThe following example demonstrates the rotation of the first 3D point from the tetrahedron on the X, Y and then Z axis using the formulas and rotation\nmatrices given above.\n\nPoint coordinates:\n- x = -100\n\n- y = 100\n\n- z = -100\n\nThe rotation angles (in radian) on each of the axles:\n\n- X = -0.5\n- Y = 1\n- Z = 0.5\n\nStep 1: Rotate the point on the X axis by -0.5 radian using the given formula (with detailed matrix multiplication):\n\n\u003cimg width=\"427\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216054633-5cc53ab1-3fb9-445a-8669-d48798211c1d.png\"\u003e\n\nStep 2: Rotating the resulting point on the Y axis by 1 radian:\n\n\u003cimg width=\"359\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216054730-50874806-10ea-468c-b141-5cdbdc40efa8.png\"\u003e\n\nStep 3: Finally rotating the point on the Z axis by 0.5 radian will result in the following:\n\n\u003cimg width=\"347\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216054800-666675e9-3197-4704-9558-4ba39723bfd6.png\"\u003e\n\n**Notes**: The demonstrated algorithm rotated only one point once on each of the three axles. This algorithm has to be applied on all points of each triangle.\nThis means that all three points of a triangle have to be rotated three times\n\n## Mapping to 2D\n1. Offset the coordinates: find the smallest x coordinate out of all of the points, if it is negative add its absolute value to every x coordinate, else do\nnothing. Do the same with the y coordinates.\n\n2. Sort the triangles: for each triangle take the average z value of the points, sort the triangles by that value in descending order.\n\n3. Write the triangles in the given order, as polygon, only the x and, y coordinates\n\n## Eiffel tower\nSample input files are provided in the initial code repository.\n\nThis is the Eiffel tower visualized after conversion:\n\nUse the following rotation angles on the three axles for the Eiffel-tower (given in radian):\n\n  - X axis: 1.8\n\n  - Y axis: -0.5\n\n  - Z axis: 0\n\n\u003cimg width=\"170\" alt=\"image\" src=\"https://user-images.githubusercontent.com/63099068/216323409-850fd950-0283-485c-b1b2-76808a0ad632.png\"\u003e\n\n## Technology\n- Read the input json with JSON-P Streaming API.\n\n- Write the SVG with StAX XML API\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcata77%2Fdata-transmission-formats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcata77%2Fdata-transmission-formats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcata77%2Fdata-transmission-formats/lists"}