-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16defe6
commit cebd15e
Showing
19 changed files
with
417 additions
and
234 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from ._version import __version__ | ||
from .notebook import CadDocument | ||
|
||
def _jupyter_labextension_paths(): | ||
return [{'src': 'labextension', 'dest': 'jupytercad'}] |
This file contains 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,2 @@ | ||
from .cad_document import CadDocument | ||
from .objects import * |
File renamed without changes.
This file contains 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 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,3 @@ | ||
from .box import Box | ||
from .placement import Placement | ||
from .base import BaseObject |
This file contains 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,11 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Dict | ||
|
||
class BaseObject(ABC): | ||
@abstractmethod | ||
def to_dict(self) -> Dict: | ||
pass | ||
|
||
@abstractmethod | ||
def from_dict(self, value: Dict) -> None: | ||
pass |
This file contains 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,30 @@ | ||
from typing import Dict | ||
|
||
from .placement import Placement | ||
from .base import BaseObject | ||
|
||
|
||
class Box(BaseObject): | ||
def __init__( | ||
self, Length=1, Width=1, Height=1, Placement=Placement() | ||
) -> None: | ||
super().__init__() | ||
self.Length = Length | ||
self.Width = Width | ||
self.Height = Height | ||
self.Placement = Placement | ||
|
||
def from_dict(self, value: Dict) -> None: | ||
self.Length = value.get('Length', None) | ||
self.Width = value.get('Width', None) | ||
self.Height = value.get('Height', None) | ||
newPlacement = Placement() | ||
self.Placement = newPlacement.from_dict(value.get('Placement', None)) | ||
|
||
def to_dict(self) -> Dict: | ||
return dict( | ||
Length=self.Length, | ||
Width=self.Width, | ||
Height=self.Height, | ||
Placement=self.Placement.to_dict(), | ||
) |
This file contains 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,19 @@ | ||
from typing import Dict | ||
from .base import BaseObject | ||
|
||
|
||
class Placement(BaseObject): | ||
|
||
def __init__(self, Position=[0,0,0], Axis=[1,0,0], Angle= 0) -> None: | ||
super().__init__() | ||
self.Position = Position | ||
self.Axis = Axis | ||
self.Angle = Angle | ||
|
||
def to_dict(self) -> Dict: | ||
return dict(Position=self.Position, Axis=self.Axis, Angle=self.Angle) | ||
|
||
def from_dict(self, value: Dict) -> None: | ||
self.Position = value.get('Position', None) | ||
self.Axis = value.get('Axis', None) | ||
self.Angle = value.get('Angle', None) |
This file contains 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,5 @@ | ||
from enum import Enum | ||
|
||
|
||
class MESSAGE_ACTION(str, Enum): | ||
ADD_OBJECT = 'add_object' |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.