Coder Social home page Coder Social logo

cad's Introduction

CAD

Perl CAD Utilities

This is set of utilities that help drawing using Perl and exporting to SVG and DXF. DXF utilities are rather limited in Perl. These modules teach me CAD while allowing me to use scripts to generate drawings and 3D objects.

CAD::Gear.pm

Draws gears. These are currently crude, while I learn the mathematics of drawing an involute gear profile. It can outputs to SVG, but will allow the "borrowing" of the points generated for other uses. Currently allows exporting of data ina "points-from-file" format that can be imported into VariCAD using 2dff.

CAD::DXF::Minimal

Generates a valid minimalist DXF file. Currently only handles lines, polylines, splines, text; other entities will be added on request, if time permits, and it becomes necessary to do so. One may generate complex drawings, in the future, but depends on interest. For more details see DXFMinimal

#!/usr/bin/perl
use strict; use warnings;
use lib "../lib/";
use CAD::Gear;
use CAD::DXF::DXFMinimal;

my $gear=Gear->new(nTeeth=>7,toothWidth=>5);
$gear->generate();
$gear->save("test.svg");

my $dxf=DXFMinimal->new();

$dxf->addEntity("line",1,4,[[23,32,0],[70,32,0]]);
$dxf->addEntity("polyline",1,4,$gear->{points});
$dxf->save("Test.dxf");

example output

dxf vs 2dff

cad's People

Contributors

saiftynet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.