Python Forum
Announcing PyMADCAD for mechanical design
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Announcing PyMADCAD for mechanical design
#1
I announce a new python module, dedicated to mechanical engineering: pymadcad

I know this purpose can be far from what many expect to do with python Big Grin That's not about network application nor machine learning nor user interface ...
But Python is greater than only the current mainstream usage. Many people are using Python for science, as a notebook or to run calculation ... For mechanics I was really frustrated to not being able to use it as well !
Hence is this module: It allows to generate meshes only from python functions in order to create full functional parts !

How do we do ?

Mostly the same way than with all CAD softwares: we define wire geometries using simple primitives (lines, arcs, splines) then we extrude it in many ways. In fact there is many more functions and many differences in MADCAD with the other softwares, but not at this level.
The API is made to make the generation extremely simple and readable.

Yet all what you need to use it is a good imagination to guess how to place points before to press 'enter' Wink

The project page

On github
There is also a documentation with some examples


So if you are searching for a way to
- make your 3D printed parts only by coding
- make parts with shape determined by algorithms
- automate a vast variety of related parts
- make kinematics schemes, or make interactive mechanisms

Then this module should be perfect for you Smile
If you have any question or idea, please don't hesitate !

Work in progress: edge chamfer and rounding

[Image: cube.png]
[Image: round.png]
Reply
#2
Awesome concept. Pymadcad is already in my bookmarks! Good luck.
Reply
#3
Thanks ! :)
Reply
#4
New feature ! general purpose chamfers and bevels

Still there is some bugs on high resolution geometries, but it works fine on common cases. I will work a bit more time on the bugs don't worry :)
Here is the result on a cube scaled on the diagonal:

initial geometry [Image: cube-deformed.png]

chamfers [Image: chamfer.png]

bevels [Image: bevel.png]

# create the deformed cube
cube = brick(Box(center=vec3(0), width=vec3(2))) .transform(scaledir(normalize(vec3(1)), 0.5))
# select the edges to process
w = [(0,1),(1,2),(2,3),(0,3),(1,5),(0,4)]

# apply operation !!
#chamfer(cube, w, ('width', 0.3))
bevel(cube, w, ('width', 0.3))
All of it relies on a propagation algorithm cutting the triangles at a fixed distance of the initial edges and corners. It wasn't that easy to make it work without issues since modifying a mesh during propagation is always tricky Cool

Documentation will come soon !
Reply
#5
I'm having hard times trying to create an algorithm that automatically generate parts starting from functional surfaces.
My current idea is to create blended surfaces like this

input to function
[Image: junction-circles-prep.png]

returned mesh
[Image: junction-circles.png]

The user can achieve this with this simple code Dance
interfaces = [
		Circle((vec3(0,0,3),vec3(0,0,1)), 1),
		Circle((vec3(-1,-1,-1),normalize(vec3(-1,-1,-1))), 1),
		Circle((vec3(1,-1,-1),normalize(vec3(1,-1,-1))), 1),
		Circle((vec3(0,1,0),normalize(vec3(0,1,-1))), 1),
		]

m = junction(
		interface[0],
		interface[1],
		interface[2],
		(interface[3], 'normal'),
		tangents='tangent',
		)
But generally speaking, does someone know a different approach to automatically build parts from sample surfaces ?
Reply
#6
Im a trial programmer but i thinks its awsome Smile
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020