!DiwdZTOGzxLddvStEY:matrix.org

CadQuery Development

575 Members
3 Servers

Load older messages


SenderMessageTime
19 Jun 2023
@_discord_186253289476587521:t2bot.ioJojain I assume he meant doing different booleans op 11:10:51
@_discord_495723561671983104:t2bot.iodspuzzles Depending on the final application, there's also the option of not booleaning for the render 11:58:10
@_discord_495723561671983104:t2bot.iodspuzzles And only booleaning for the final product 11:58:25
@_discord_774666487407443978:t2bot.io.nesdnuma joined the room.12:25:31
20 Jun 2023
@_discord_601678405334990849:t2bot.ioalgomancer changed their display name from algomancer to algomancer#0.00:54:14
@_discord_601678405334990849:t2bot.ioalgomancer changed their display name from algomancer#0 to algomancer.00:54:16
@_discord_601678405334990849:t2bot.ioalgomancer Is there a nice way to dump the entire occ brep to a python dictionary and convert it back to an occ shape later? 00:54:45
@_discord_896482168103125002:t2bot.ioroger_maitland Are you looking for the equivalent to a BREP export in an internal dictionary or just the Shapes in a dictionary? 01:10:18
@_discord_601678405334990849:t2bot.ioalgomancer So, actually I just need a type that I can convert to numpy/tensor types (a python native representation). I am doing analysis work rather than creation.

Basically if I could convert it into a python dictionary, i'd be able to do it from there. Fighting up against being a newbie on the occ kernel / brep.

Realized I don't know all the gotchas when I tried to do this and ended up with a bunch of brep check errors. Probs just need to grind on it a bit longer.
01:13:07
@_discord_601678405334990849:t2bot.ioalgomancer I'll need the whole brep graph. 01:14:20
@_discord_601678405334990849:t2bot.ioalgomancer * I'll need the whole brep graph - since i'll be doing some batched analysis. 01:15:09
@_discord_601678405334990849:t2bot.ioalgomancer But I don't need the rest of the kernel. 01:15:33
@_discord_209043174960660490:t2bot.iojernd What kind of analysis are you looking to do? 01:16:01
@_discord_601678405334990849:t2bot.ioalgomancer I am trying to make a differentiable brep for differentiable rendering. 01:16:19
@_discord_601678405334990849:t2bot.ioalgomancer And want it compatible with occ's brep 01:16:46
@_discord_601678405334990849:t2bot.ioalgomancer I can do the math side of it, just struggling against the particulars of the occ kernel. 01:17:20
@_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

Show newer messages


Back to Room ListRoom Version: 9