makeclean / occ_faceter

GNU Lesser General Public License v2.1
4 stars 6 forks source link

adding mixed edge test shape #18

Open shimwell opened 3 years ago

shimwell commented 3 years ago

Hi all

This PR is the first in a series of PR that aim to add new test shapes as discussed #17

This particular PR adds a shape that has multiple different types of edges (spline, circle, straight)

Screenshot from 2020-10-22 11-23-29

This shape was made with the following code

import paramak

cube = paramak.ExtrudeStraightShape(points=[(10, -10), (300, -10), (300, 110), (10,110)],
                                    distance=120,
                                    material_tag='cub_mat')

extruded_mixed = paramak.ExtrudeMixedShape(
    points=[
        (100, 0, "straight"),
        (200, 0, "circle"),
        (250, 50, "circle"),
        (200, 100, "straight"),
        (150, 100, "spline"),
        (140, 75, "spline"),
        (110, 45, "spline"),
    ],
    distance=100,
    material_tag='extruded_mixed_mat'
)
cube.solid = cube.solid.cut(extruded_mixed.solid)
cube.export_stp('cube.stp')
extruded_mixed.export_stp('extruded_mixed.stp')

Then the PPP was used to make the brep

makeclean commented 3 years ago

I presume there are two solids there? Its hard to tell from the vis?

shimwell commented 3 years ago

Yep I think there are two solids in there. The brep shows it as one in freecad, but I think this is just how breps from the ppp arrive. But I can change it a bit to make it clearer

Screenshot from 2020-10-22 11-39-32

Screenshot from 2020-10-22 11-39-08

shimwell commented 3 years ago

Rotated the shape and made it a little more complex

import paramak

cube = paramak.ExtrudeStraightShape(points=[(10, 10), (300, 10), (300, 110), (10,110)],
                                    distance=120,
                                    extrude_both=False,
                                    material_tag='cub_mat',
                                   azimuth_placement_angle=10)

extruded_mixed = paramak.ExtrudeMixedShape(
    points=[
        (100, 0, "straight"),
        (200, 0, "circle"),
        (250, 50, "circle"),
        (200, 100, "straight"),
        (150, 100, "spline"),
        (140, 75, "spline"),
        (110, 45, "spline"),
    ],
    distance=100,
    material_tag='extruded_mixed_mat'
)

cube.solid = cube.solid.cut(extruded_mixed.solid)

my_reactor = paramak.Reactor(shapes_and_components=[cube,extruded_mixed])
my_reactor.export_stp()
my_reactor.export_neutronics_description('manifest.json', include_graveyard=False)

Screenshot from 2020-10-22 12-45-08 Screenshot from 2020-10-22 12-45-34

Happy to make changes but just wanted to commit it before I forget or lost it somehow