-
Notifications
You must be signed in to change notification settings - Fork 38
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
Made Disk and SplineRoundDisk robust to transformations #66
Made Disk and SplineRoundDisk robust to transformations #66
Conversation
Created new spline method for creating a spline for the core, which is stable on transformation. Just run add_spline_edges after modifying the core points...
correcting chops in QuarterDisk
…er method to work for angles < 2pi
…ld be added to parts) Changed point reference from grid[1][x] to shell[x] to work with rings.
…re made robust for transformation of points.
Excellent work, I'll take a look ASAP |
I tried to merge your changes but there are some issues (failing tests, type checking, etc.). Do you have your IDE prepared as instructed in https://github.com/damogranlabs/classy_blocks/blob/development/CONTRIBUTING.md? Pre-commit hook should run tests, analyze typing, sort imports, format code, ... Let me know if you need any help setting that up. It seems your code contains a lot of lines like |
Hi, I somehow missed your reply and didn't notice it before I was impatient and started looking for a reply.
I did not run those precommit checks. Im still not used to doing things the proper way.
I have now done it.
python -m pytest
gave 2 errors, but nothing related to my changes.
ERROR tests/test_items/test_block.py
ERROR tests/test_items/test_wire.py
mypy src tests
Gave a couple of two long line and I had to add Optional to som variables. This is corrected.
src\classy_blocks\construct\flat\sketches\disk.py:166: error: "ElementBaseT" has no attribute "origo" [attr-defined]
I needed to add the attribute origo as I wanted to be able to move the core, but still have the outer pooints defined from the original center.
That meant I had to remimplement the transformations, which gives me the proplem. Alternatively it could be added to self.parts, but I was not sure that was a good idea.
I have some problems as i base the the SplineRound on top of the DiskBase, as I need additional variables for the core_spline method.
I'm not sure why it is a problem that there are more variables in the reimplemated method.
How do I best update my merge request with my small changes?
Regarding the repeating code in the correct_disk method. You might have a point. Maybe I could make methrod, that worked for all 3 sketches based on the size of the core. But I fear it will be rather hard to figure out exactly what it does. I don't think I can parameterize it easily, but I might be wrong.
Best regards
Lasse
…________________________________
Fra: Nejc Jurkovič ***@***.***>
Sendt: 14. december 2024 18:13
Til: damogranlabs/classy_blocks ***@***.***>
Cc: LasseHolch ***@***.***>; Author ***@***.***>
Emne: Re: [damogranlabs/classy_blocks] Made Disk and SplineRoundDisk robust to transformations (PR #66)
I tried to merge your changes but there are some issues (failing tests, type checking, etc.). Do you have your IDE prepared as instructed in https://github.com/damogranlabs/classy_blocks/blob/development/CONTRIBUTING.md? Pre-commit hook should run tests, analyze typing, sort imports, format code, ... Let me know if you need any help setting that up.
It seems your code contains a lot of lines like (self.side_1 + r_1 * np.cos(np.pi / 4)) * self.u_1, is there a way to un-repeat those? For instance, you could create a specialized parametric Curve object that would calculate that and re-use it in all round sketches. I can't tell you exactly what to do, I didn't have time to thoroughly check what your code does. I'd gladly help but I've been terribly busy last few weeks and it will stay so for the next few...
—
Reply to this email directly, view it on GitHub<#66 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOHXKFK3CKEJZDL567OX2OT2FRRNFAVCNFSM6AAAAABTKZGF7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBTGE4DQNBYHE>.
You are receiving this because you authored the thread.
|
Okay, if you're not in a hurry, you can just commit your changes on your local branch and I'll pull them and see what I can do. First I have to finish my W.I.P. though - but it looks promising so I might even get it done! In a while, of course. :) |
After a bit of googling it seems like i could just commit as usual and the merge request is updated.
At least that is what I have tried.
Let me know if there is anything I can do to help the request on the way...
Also, can you merge the shape_optimization feature to the main branch. I can add an example where a cylinder decreases in diameter. That should both show illustrate my improvement to the disk, and the usage of shape optimization.
I have a bit of a deadline as I will be on parental leave for four months from the 20th. Though I in principle could do a bit of coding, I expect it to be very limited...
…________________________________
Fra: Nejc Jurkovič ***@***.***>
Sendt: 2. januar 2025 20:42
Til: damogranlabs/classy_blocks ***@***.***>
Cc: LasseHolch ***@***.***>; Author ***@***.***>
Emne: Re: [damogranlabs/classy_blocks] Made Disk and SplineRoundDisk robust to transformations (PR #66)
Okay, if you're not in a hurry, you can just commit your changes on your local branch and I'll pull them and see what I can do. First I have to finish my W.I.P. though - but it looks promising so I might even get it done! In a while, of course. :)
—
Reply to this email directly, view it on GitHub<#66 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOHXKFPRJ2MX4H4SJKGTQHL2IWJCBAVCNFSM6AAAAABTKZGF7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRYGI4DEMZQGA>.
You are receiving this because you authored the thread.
|
I modified your code a bit and merged your PR.
Of course you won't have time on your parental leave, I've just been on one and wrote only somewhere around zero lines. But if you - by some weird coincidence - do find yourself programming, I strongly recommend you write tests for your splined shapes. If you cover your code with tests, I'll be able to refactor it with greater confidence I don't mess your code up.
I merged your updates into development branch but I don't think I'll be able to push all that into master just yet. The development branch is currently terribly messy with semi-finished features I still have to finish and that is not ready for the master yet. Is this a problem? Can you Anyway, thank you for your contribution! |
Disks
SplineRoundDisk
Annulus
Cylinder: