-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add functions to generate drafts #65
base: master
Are you sure you want to change the base?
Conversation
tab indent, some clean up
@jimy-byerley this pr is ready for ur input featruesdraft by groups, for adding draft on extruded(Mesh) TODO
testingu can test on the darft funcs by running:
to plot all drafts:
questions:
|
Hello The draft is made as a modification of an already generated mesh (the result of an
I like however the I propose the following:
Sorry for the very long answer. I think your efforts deserved some long explanations of my thinkings |
I forgot a minor point: |
oh, i wasn't aware that was new feature of python, ill fix it |
Yeah I agree for a function to depend on "knowing" the implementation details(detailed dependency) of another this is bad design. What do think of this alternative solution: def extrusion(trans, line: Web, alignment:float=0, draft_angle=0) -> Mesh: |
Ill add some more tests cases of "weird" meshes ;) and take a shoot at "handling self-intersection" |
generalized private extrude function
The reason why draft failed in this case was that show([mesh]) mutated the mesh in way that extended mesh with points that where not used by any face. When i first wrote the function i did not consider the case of dirty meshes. I have now added a test case for the draft function with dirty meshes. |
the draft function can now deal with dirty meshes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this PR needs to be polished before to be merged: it needs docs and a bit of module cleanup
return n3 * scale | ||
|
||
|
||
def edges_with_points(edges, pids, only=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this function ? it doesn't seems to be used anywhere
madcad/prelude.py
Outdated
@@ -0,0 +1,24 @@ | |||
""" | |||
lazy imports for common utilites, globals and containers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, the root module madcad
already serve that purpose. It exposes most of the end-user functions.
From the user perspective there is not need of an other exposing-only module, except eventually if we add one to expose only types and no functions.
From the developer perspective one more thing is to consider: the module loading order.
At contrary to compiles languages, python is loading modules by executing their code. So imagine the following scenario:
# the user is loading madcad for the first time
import madcad # this will start loading of madcad/__init__.py
# madcad/__init__.py
from .draft import draft # this actually pause the loading of __init__.py to load draft.py and pick its content
# madcad/draft.py
from madcad import ... # this finds __init__.py already initialized but partially loaded, so part of its content is not there yet.
For that reason, the madcad submodules should not import from the root module like in that prelude file, but only from other submodules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what i want as developer is be able to import some commonly used "core" stuff to reduce boilerplate code inside test_code and the modules that are not "core". I did not write the prelude.py with the end user in mind
Also for the consistence of the API (and user convenience):
|
As a mechanical engineer i consider it bad practice to add drafts on beveled geometry. |
i think i understand what behavior u want for the sphere now. Something like a chamfer but in way that caps the draft angles |
TODO
|
|
draft_cuts is perhaps a better name? |
My thoughts about drafts on a sphere is something like this: There is a self-intersection problem between the expanded flanges, because there is flanges drafting from the bottom and flanges drafting from the top. The complex cases has to be handled if we are about to add a generic |
Not sure, as such this function will be a very general function, maybe a general name like |
What I was thinking about when I mentioned draft cut was similar to ur drawings but instead of adding material to cap drafts I was thinking remove material. So add_drafts we could call the behaviour u decribed. cut_drafts would be similar. But it would not be tangent but it can instead persevere the outline at the neutral plane |
The draft() implementation I wrote behaves like a drafty offset. So maybe we should call it something like that. Perhaps draft_transform |
+1 on that
perhaps yes |
I propose that draft_transform have the fallowing signature:
inplace toggles mutation |
more docs
renamed some while testing drafts render orthographic
relates to: #64
added import helper