Involute
Involute

Reputation: 245

Create DXF file from polygon of points using Java

Apologies in advanced for my lack of experience in Java programming. I'm trying to create a profile generator for drawing the 2D outline of a gear as a polygon of many points, and am looking for a means of storing this profile in a DXF format. Currently, I've been using the program, OpenSCAD, to generate the profile using an iterative method, and it comes with the option of exporting 2D geometry as DXFs. The results are decent, but the program lacks the proper programming language to work with more complex gear profiles; this is why I want to use Java (the programming language I'm most to grips with) to generate the gear profile. The problem is, I'm neither familiar enough with Java nor DXFs to know how to use the former to create the latter! I reckon however that if OpenSCAD, or even Dr. Rainer Hessmer's gear generator can create their own DXF files, why can't Java. I've passively picked up that a DXF file is much like a text file, so if there exists an approach similar to writing a text file in Java, that would be the most preferred option.

Many thanks and I appreciate any help.

Upvotes: 0

Views: 621

Answers (1)

Scott Leslie
Scott Leslie

Reputation: 1197

Why not use Java to generate OpenSCAD code (as a text file) which can generate the gears? There a a fair number of tools which use Python to do this.

Upvotes: 0

Related Questions