!DiwdZTOGzxLddvStEY:matrix.org

CadQuery Development

575 Members
3 Servers

Load older messages


SenderMessageTime
20 Jun 2023
@_discord_601678405334990849:t2bot.ioalgomancer But, definately havn't spent enough time on it, figured i'd ask here, incase I can short cut it. 01:17:39
@_discord_896482168103125002:t2bot.ioroger_maitland With build123d one can do: print(Box(1, 1, 1).show_topology()) which results in:
Compound                       at 0x7eff74eb1770, Center(0.0, 0.0, 0.0)
└── Solid                      at 0x7eff8a3ad370, Center(0.0, 0.0, 0.0)
    └── Shell                  at 0x7eff0b4c5e70, Center(0.0, 0.0, 0.0)
        ├── Face               at 0x7eff3fd63cb0, Center(-0.5, 0.0, 0.0)
        │   └── Wire           at 0x7eff0b4cc470, Center(-0.5, 0.0, 0.0)
        │       ├── Edge       at 0x7eff0b4cc530, Center(-0.5, -0.5, 0.0)
        │       │   ├── Vertex at 0x7eff0b4cc5f0, Center(-0.5, -0.5, 0.5)
        │       │   └── Vertex at 0x7eff0b4cc770, Center(-0.5, -0.5, -0.5)
        │       ├── Edge       at 0x7eff0b4cc6b0, Center(-0.5, 0.0, 0.5)

It wouldn't be difficult to hack the code to create a dictionary.
01:19:15
@_discord_601678405334990849:t2bot.ioalgomancer How much trouble would the inverse operation be for build123d? 01:19:39
@_discord_601678405334990849:t2bot.ioalgomancer Like dict -> toposhape 01:19:48
@_discord_896482168103125002:t2bot.ioroger_maitland It's work for sure but it can be done. 01:20:12
@_discord_601678405334990849:t2bot.ioalgomancer That's really helpful regardless, i'll read through it. 01:20:13
@_discord_601678405334990849:t2bot.ioalgomancer It'll be an open source project, so it'd plug right into build123 which will be cool. 01:20:40
@_discord_896482168103125002:t2bot.ioroger_maitland https://build123d.readthedocs.io/en/latest/direct_api_reference.html#topology.Shape.show_topology There's a link to the source there. 01:20:45
@_discord_601678405334990849:t2bot.ioalgomancer Thanks a lot 01:20:56
@_discord_186253289476587521:t2bot.ioJojain What is a differentiable brep ? I'm having an hard time understanding what data you need and what you want to do with it 05:45:42
@_discord_601678405334990849:t2bot.ioalgomancer differentiable brep would mean you compute a gradient on changes to do gradient based optimisation.

The data I need would be most analogous to dumping the occ (geometric and toplogical info) brep to json (a python dict).

I've start making pretty good progress thanks to rogers suggestion. Should have it by the end of the day, just fixing some wires issues on the reconstruction.

The data model will look something like this once I am done, with python primitives.

class Vertex(BaseModel):
    location: Tuple[float, float, float]


class Edge(BaseModel):
    curve: GeomCurve  # The curve data model defined above
    start_vertex: Vertex
    end_vertex: Vertex
    orientation: Literal['forward', 'reversed']

class Wire(BaseModel):
    edges: List[Edge]  # Edges in the order they are connected

class Face(BaseModel):
    surface: GeomSurface  # The surface data model defined above
    outer_wire: Wire  # Outer boundary of the face
    inner_wires: List[Wire] = []  # Inner boundaries (holes), if any

class Shell(BaseModel):
    faces: List[Face]  # Faces forming the shell

class Solid(BaseModel):
    shells: List[Shell]  # Shells forming the solid, usually one outer shell and possibly multiple inner shells

class BRep(BaseModel):
    solids: List[Solid]  # Solids forming the BRep model


Its just a serialisation layer so I can pop it into gpu accelerated math functions.
05:53:28
@_discord_601678405334990849:t2bot.ioalgomancer * differentiable brep would mean you can compute a gradient on changes to do gradient based optimisation.

The data I need would be most analogous to dumping the occ (geometric and toplogical info) brep to json (a python dict).

I've start making pretty good progress thanks to rogers suggestion. Should have it by the end of the day, just fixing some wires issues on the reconstruction.

The data model will look something like this once I am done, with python primitives.

class Vertex(BaseModel):
    location: Tuple[float, float, float]


class Edge(BaseModel):
    curve: GeomCurve  # The curve data model defined above
    start_vertex: Vertex
    end_vertex: Vertex
    orientation: Literal['forward', 'reversed']

class Wire(BaseModel):
    edges: List[Edge]  # Edges in the order they are connected

class Face(BaseModel):
    surface: GeomSurface  # The surface data model defined above
    outer_wire: Wire  # Outer boundary of the face
    inner_wires: List[Wire] = []  # Inner boundaries (holes), if any

class Shell(BaseModel):
    faces: List[Face]  # Faces forming the shell

class Solid(BaseModel):
    shells: List[Shell]  # Shells forming the solid, usually one outer shell and possibly multiple inner shells

class BRep(BaseModel):
    solids: List[Solid]  # Solids forming the BRep model


Its just a serialisation layer so I can pop it into gpu accelerated math functions.
05:53:49
@_discord_601678405334990849:t2bot.ioalgomancer Ie geom surface would just be primitives.

class GeomCylindricalSurface(GeomSurface):
location: Tuple[float, float, float]
normal: Tuple[float, float, float]
radius: float

I'll turn this into a pytorch/numpy type once I can make sure the brep->datamodel->brep works.
05:57:36
@_discord_186253289476587521:t2bot.ioJojain What abot brep surfaces ? It's not as simple as cylindrical surface 06:06:35
@_discord_186253289476587521:t2bot.ioJojain * What about brep surfaces ? It's not as simple as cylindrical surface 06:11:23
@_discord_601678405334990849:t2bot.ioalgomancer I currently convert to all of the OCC.Core.Geom types. 06:18:34
@_discord_186253289476587521:t2bot.ioJojain Mhhm ok curious to see what you'll end up doing. I still doesn't fully understand the goal haha 06:49:39
@_discord_332903554807234560:t2bot.ioqwelyt I suppose it all depends on you frame of reference. I'm damaged from work. Anything above 50ms is slow. I don't think I've ever been able to produce things in cad that was done in that time. 08:40:08
@_discord_814463110696927262:t2bot.iogiannissc changed their display name from giannissc to giannissc#0.09:54:46
@_discord_814463110696927262:t2bot.iogiannissc changed their display name from giannissc#0 to giannissc.09:54:48
@_discord_186253289476587521:t2bot.ioJojain Yes of course, slow and fast have meaning only relative to something else. Computting a model from scratch can be slow from a human perspective but computing each operation one at a time (like in interactive GUI CAD) is most of the time instantaneous. 10:26:15
@_discord_1120808865617940612:t2bot.iovadym joined the room.20:18:56
21 Jun 2023
@_discord_598447107849846794:t2bot.iofractalpixel joined the room.09:26:22
@_discord_1121009669398339692:t2bot.iofrediz joined the room.09:32:43
@_discord_825395471031861309:t2bot.iobernhard42 changed their display name from bernhard#0011 to bernhard42#0.10:53:22
@_discord_825395471031861309:t2bot.iobernhard42 changed their display name from bernhard42#0 to bernhard42.10:53:24
@_discord_896482168103125002:t2bot.ioroger_maitland changed their display name from Roger Maitland#7070 to roger_maitland#0.13:26:42
@_discord_896482168103125002:t2bot.ioroger_maitland changed their display name from roger_maitland#0 to roger_maitland.13:26:43
@_discord_141246338506555392:t2bot.iojorgeffonte changed their display name from jorgeffonte to jorgeffonte#0.14:36:42
@_discord_141246338506555392:t2bot.iojorgeffonte changed their display name from jorgeffonte#0 to jorgeffonte.14:36:45

Show newer messages


Back to Room ListRoom Version: 9