-
Notifications
You must be signed in to change notification settings - Fork 60
Exporter DRC UI #1214
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
Draft
Dhruv-0-Arora
wants to merge
32
commits into
dev
Choose a base branch
from
dhruv/1882/drc-ui-support
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Exporter DRC UI #1214
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
a2f99d3
feat: adding design check tab to exporter
Dhruv-0-Arora 066e38c
feat: adding height and perimeter rule checks
Dhruv-0-Arora 4fa43c8
feat: adding DRC UI
Dhruv-0-Arora a968146
Merging Dev
Dhruv-0-Arora 5021b5b
fix: formatting and mypy
Dhruv-0-Arora cecb5d9
formatting
Dhruv-0-Arora fbd2574
Merge branch 'dev' into dhruv/1882/drc-ui-support
Dhruv-0-Arora b0df31b
feat: adding table with icons showing validity
Dhruv-0-Arora fe3e116
Merging Local
Dhruv-0-Arora 6d2e608
feat: adding invalid and proper perimeter validation
Dhruv-0-Arora 140645b
formatting
Dhruv-0-Arora c8d5c60
Merge branch 'dev' into dhruv/1882/drc-ui-support
PepperLola 5e46d91
fix: removing orientedboundingbox
Dhruv-0-Arora 00b1242
Merging Dev
Dhruv-0-Arora 9130b8a
feat: adding extensibility
Dhruv-0-Arora 1a5eb20
fix: formatting
Dhruv-0-Arora 5ad15c1
fix: mypy
Dhruv-0-Arora 1cb1f5c
feat: typing and resolving mypy
Dhruv-0-Arora 6aee78b
feat: changing calculations using different orientations of the bound…
Dhruv-0-Arora 134b42f
Merging Dev and Formatting
Dhruv-0-Arora e031d0b
Merging Dev
Dhruv-0-Arora e9e3f49
feat: adding web tab
Dhruv-0-Arora fe2327f
feat: sending designRuleChecks to web-based UI
Dhruv-0-Arora efcfde1
feat: adding json dumps and fixing callable functions
Dhruv-0-Arora f43d4e5
merging dev
Dhruv-0-Arora b05fd8e
fix: conflicts
Dhruv-0-Arora 77f852b
fix: table not displaying on tab
Dhruv-0-Arora af430a8
feat: adding validation header
Dhruv-0-Arora 0fe4a98
fix: biome errors and formatting
Dhruv-0-Arora 01abb79
fix: sendData run when window is undefined
Dhruv-0-Arora 8d4b88d
Merge branch 'dev' into dhruv/1882/drc-ui-support
Dhruv-0-Arora 9fd087d
fix: removing redundant state implementation
Dhruv-0-Arora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| from typing import List, TypedDict, Callable | ||
|
|
||
| import adsk.core | ||
| import adsk.fusion | ||
|
|
||
| from src import Logging, gm | ||
|
|
||
| class DesignRule(TypedDict): | ||
| name: str | ||
| calculation: Callable[[], float] | ||
| max_value: float | ||
|
|
||
| class DesignRuleChecks: | ||
| designRules: List[DesignRule] | ||
|
|
||
| @Logging.logFailure | ||
| def __init__(self) -> None: | ||
| self.designRules = [ | ||
| { | ||
| "name": "Design Height", | ||
| "calculation": self.fusion_design_height, | ||
| "max_value": 106.0, # cm | ||
| }, | ||
| { | ||
| "name": "Design Perimeter", | ||
| "calculation": self.fusion_design_perimeter, | ||
| "max_value": 304.0, # cm | ||
| }, | ||
| ] | ||
|
|
||
|
|
||
| def getDesignRules(self) -> List[DesignRule]: | ||
| return self.designRules | ||
|
|
||
| @Logging.logFailure | ||
| def fusion_design_height(self) -> float: | ||
| design = adsk.fusion.Design.cast(gm.app.activeProduct) | ||
| if design: | ||
| overall_bounding_box = design.rootComponent.orientedMinimumBoundingBox | ||
| return float(overall_bounding_box.width) | ||
| return 0.0 | ||
|
|
||
| @Logging.logFailure | ||
| def fusion_design_perimeter(self) -> float: | ||
| design = adsk.fusion.Design.cast(gm.app.activeProduct) | ||
| if design: | ||
| overall_bounding_box = design.rootComponent.orientedMinimumBoundingBox | ||
| return float(2 * (overall_bounding_box.height + overall_bounding_box.length)) | ||
| return 0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This needs to be dumped as json