Skip to content

COMPONENTS / MOUNTING-RAIL-M8

Mounting Rail M8

250 mm 27/18 perforated sheet rail, product-aligned from one end and folded opening-up

Built in SolidCraft 0.49.0 31 commands

Model preview

Mounting Rail M8 SolidCraft build

A reusable light mounting-rail component authored in fabrication order as native sheet metal: developed flat blank, four source perforations, one repeated native feature pattern and four 90-degree folds. The supplied DRESSELHAUS/HORNBACH product establishes 1000 mm length, galvanized steel, M8 use and 1.25 mm thickness. The 27 × 18 mm section and perforation dimensions use a generic published 27/18 rail reference and are not claimed as DRESSELHAUS manufacturing dimensions.

Key dimensions: 250 mm default length; first round opening 12.5 mm from Y=0; 2 repeat units at editable 100 mm repeat pitch; fixed 27 × 18 × 1.25 mm reference section; 15 mm opening; R1.25/K0.40 bend rule

Open in SolidCraft Web

The editable .sc model is loaded directly from the accepted build branch.

Background

Mounting rail

Generic galvanized M8 mounting rail, modelled as a 27 × 18 × 1.25 mm C-profile. The standalone CAD example is 250 mm long; the retail reference product is sold as a 1 metre rail.

This type of light installation rail is also commonly seen at originally German DIY/building-supply chains in the Netherlands. Its profile and punch layout resemble the MÜPRO MPC 27/18 system.

Repeating hole pattern

One 100 mm repeat consists of:

  • Ø12.5 mm round hole;
  • 10 × 6.4 mm longitudinal slot;
  • Ø12.5 mm round hole;
  • 15 × 8.4 mm transverse slot.

The four feature centres are 25 mm apart. The model repeats this complete four-feature unit as one native pattern.

References

Product/photo reference: HORNBACH — DRESSELHAUS M8 mounting rail.

Possible additional geometry references: MÜPRO MPC 27/18/1.25 data sheet and MÜPRO MPC European Technical Assessment.

The MÜPRO documents are used as generic 27/18 references.

Product reference and perforation review

The local product image is retained for visual comparison; only the cropped derivative is rendered on the page.

Reference product — Source: HORNBACH / DRESSELHAUS Galvanized M8 mounting rail reference
Rear view — complete repeat pattern Mounting Rail M8 straight rear view showing the perforation pattern
Right-end view — 27 × 18 C-profile with 15 mm opening Mounting Rail M8 right-end view showing the C-profile
Four-feature repeat — round, longitudinal slot, round, transverse slot Mounting Rail M8 perforation pattern close-up

SCPF source

The exact SCPF Python source declared by this build variant.

scpf/model.py
"""Generic M8 mounting rail using native SolidCraft sheet metal.

The rail is manufactured in the same order as a real perforated rail:

    flat blank -> four-source perforation pattern -> four 90-degree folds

The flat-first route avoids attaching recess Sketches to an already-bent sheet
panel. The four physical source cuts remain one native repeated feature group.
"""

from math import pi

from scpf import (
    Axis,
    Circle2D,
    Polygon2D,
    Sketch,
    SlotCenterToCenter2D,
    component,
)


@component(include=("length", "repeat_count", "repeat_pitch"))
class MountingRailM8:
    # Standalone presentation default. The retail reference is 1000 mm.
    length = 250.0

    # Native editable repeat controls.
    repeat_count = 2
    repeat_pitch = 100.0

    # Generic 27/18 reference geometry.
    PROFILE_WIDTH = 27.0
    PROFILE_HEIGHT = 18.0
    THICKNESS = 1.25
    OPENING = 15.0

    BEND_RADIUS = 1.25
    K_FACTOR = 0.40

    FEATURE_PITCH = 25.0

    ROUND_DIAMETER = 12.5
    HORIZONTAL_SLOT_LENGTH = 10.0
    HORIZONTAL_SLOT_WIDTH = 6.4
    VERTICAL_SLOT_LENGTH = 15.0
    VERTICAL_SLOT_WIDTH = 8.4

    def build(self):
        thickness = self.THICKNESS

        # Develop the requested 27 x 18 outer section with the same 15 mm
        # opening. For a 90-degree centreline fold SolidCraft removes a bend
        # zone equal to BA = pi/2 * (R + K*T). Relative to the requested
        # outside virtual sharp, each fold centre therefore sits inward by:
        #
        #   projection = (R + T) - BA/2
        #
        # Applying that projection at every bend gives the flat distances
        # between fold centre lines and the free lip edges.
        bend_allowance = (
            pi / 2 * (self.BEND_RADIUS + self.K_FACTOR * thickness)
        )
        bend_projection = (
            self.BEND_RADIUS + thickness - bend_allowance / 2
        )

        back_span = self.PROFILE_WIDTH - 2 * bend_projection
        side_span = self.PROFILE_HEIGHT - 2 * bend_projection
        lip_outer = (self.PROFILE_WIDTH - self.OPENING) / 2
        lip_span = lip_outer - bend_projection

        flat_width = back_span + 2 * side_span + 2 * lip_span
        flat_half = flat_width / 2
        inner_fold_x = back_span / 2
        outer_fold_x = inner_fold_x + side_span

        # Local component contract:
        #   +Y is rail length and Y=0 is the product-pattern start side.
        #   The C-opening points toward +Z for the standalone rail.
        #   The perforated back web occupies Z=0..THICKNESS.
        back_inner_z = 0.0
        back_outer_z = thickness

        with Sketch(
            name="Flat rail blank",
            plane="XY",
            origin=(0, 0, back_inner_z),
        ) as blank:
            Polygon2D(
                [
                    (-flat_half, 0),
                    (flat_half, 0),
                    (flat_half, self.length),
                    (-flat_half, self.length),
                ]
            )

        rail = blank.sheet_metal(
            thickness=thickness,
            bend_radius=self.BEND_RADIUS,
            k_factor=self.K_FACTOR,
            rule_name="Mounting Rail M8 Rule",
        )

        # The physical product pattern starts from one rail end instead of
        # being centred in whatever presentation length happens to be used.
        # The first round opening is 12.5 mm from Y=0 for both the standalone
        # 250 mm example and the 1000 mm assembly rail.
        length_value = float(self.length.value)
        repeat_count_value = int(self.repeat_count.value)
        repeat_pitch_value = float(self.repeat_pitch.value)
        source_span = 3 * self.FEATURE_PITCH
        patterned_span = (
            (repeat_count_value - 1) * repeat_pitch_value
            + source_span
        )
        end_offset = 12.5
        if end_offset + patterned_span > length_value:
            raise ValueError(
                "mounting rail repeat pattern does not fit inside the rail length"
            )

        y0 = end_offset
        y1 = y0 + self.FEATURE_PITCH
        y2 = y0 + 2 * self.FEATURE_PITCH
        y3 = y0 + 3 * self.FEATURE_PITCH

        horizontal_center_distance = (
            self.HORIZONTAL_SLOT_LENGTH - self.HORIZONTAL_SLOT_WIDTH
        )
        vertical_center_distance = (
            self.VERTICAL_SLOT_LENGTH - self.VERTICAL_SLOT_WIDTH
        )

        # Cut the still-flat back panel from an explicit world XY plane. This
        # intentionally avoids the already-bent sheet face/panel attachment
        # state that SolidCraft 0.48.1 misclassifies in live replay.
        cut_depth = -(2 * thickness)

        with Sketch(
            name="Repeat round A",
            on=rail,
            plane="XY",
            origin=(0, 0, back_outer_z),
        ) as round_a:
            round_a.add(
                Circle2D(d=self.ROUND_DIAMETER),
                offset=(0, y0),
            )
        round_a_cut = round_a.extrude(cut_depth)
        rail = rail - round_a_cut

        with Sketch(
            name="Repeat horizontal slot",
            on=rail,
            plane="XY",
            origin=(0, 0, back_outer_z),
        ) as horizontal_slot:
            half = horizontal_center_distance / 2
            SlotCenterToCenter2D(
                (0, y1 - half),
                (0, y1 + half),
                self.HORIZONTAL_SLOT_WIDTH,
            )
        horizontal_cut = horizontal_slot.extrude(cut_depth)
        rail = rail - horizontal_cut

        with Sketch(
            name="Repeat round B",
            on=rail,
            plane="XY",
            origin=(0, 0, back_outer_z),
        ) as round_b:
            round_b.add(
                Circle2D(d=self.ROUND_DIAMETER),
                offset=(0, y2),
            )
        round_b_cut = round_b.extrude(cut_depth)
        rail = rail - round_b_cut

        with Sketch(
            name="Repeat vertical slot",
            on=rail,
            plane="XY",
            origin=(0, 0, back_outer_z),
        ) as vertical_slot:
            half = vertical_center_distance / 2
            SlotCenterToCenter2D(
                (-half, y3),
                (half, y3),
                self.VERTICAL_SLOT_WIDTH,
            )
        vertical_cut = vertical_slot.extrude(cut_depth)
        rail = rail - vertical_cut

        rail = rail.rectangular_pattern(
            (
                round_a_cut,
                horizontal_cut,
                round_b_cut,
                vertical_cut,
            ),
            count=self.repeat_count,
            spacing=self.repeat_pitch,
            direction=Axis.Y,
        )

        # Fold the lips first while all four bend lines are still available in
        # the original flat plane. Then fold both side walls upward. Keeping
        # the centre/back panel fixed gives the standalone rail a +Z opening.
        fixed = (0.0, length_value / 2, back_inner_z)
        line_y = (0.0, length_value)

        rail = rail.fold(
            line=(
                (-outer_fold_x, line_y[0], back_inner_z),
                (-outer_fold_x, line_y[1], back_inner_z),
            ),
            angle=90,
            fixed=fixed,
            flip=False,
        )
        rail = rail.fold(
            line=(
                (outer_fold_x, line_y[0], back_inner_z),
                (outer_fold_x, line_y[1], back_inner_z),
            ),
            angle=90,
            fixed=fixed,
            flip=False,
        )
        rail = rail.fold(
            line=(
                (-inner_fold_x, line_y[0], back_inner_z),
                (-inner_fold_x, line_y[1], back_inner_z),
            ),
            angle=90,
            fixed=fixed,
            flip=False,
        )
        rail = rail.fold(
            line=(
                (inner_fold_x, line_y[0], back_inner_z),
                (inner_fold_x, line_y[1], back_inner_z),
            ),
            angle=90,
            fixed=fixed,
            flip=False,
        )

        return rail.with_material(
            "Galvanized steel",
            density_g_cm3=7.85,
            color="#9EA6AA",
        )


MountingRailM8()
SolidCraft command sequence 31 generated operations · expand to inspect
  1. parameters.add
    {
       "expression": "250",
       "name": "length",
       "unit": "mm"
    }
    
  2. parameters.add
    {
       "expression": "2",
       "name": "repeat_count",
       "unit": ""
    }
    
  3. parameters.add
    {
       "expression": "100",
       "name": "repeat_pitch",
       "unit": "mm"
    }
    
  4. sheet.manage_rules
    {
       "active": true,
       "bend_radius": 1.25,
       "k_factor": 0.4,
       "name": "Mounting Rail M8 Rule",
       "thickness": 1.25
    }
    
  5. sketch.create
    {
       "name": "Flat rail blank",
       "plane": {
          "origin": [
             0,
             0,
             0
          ],
          "x_dir": [
             1,
             0,
             0
          ],
          "y_dir": [
             0,
             1,
             0
          ]
       }
    }
    
  6. sketch.line
    {
       "closed": true,
       "ids": [
          "a",
          "b",
          "c",
          "d"
       ],
       "points": [
          [
             -32.99778714378214,
             0
          ],
          [
             32.99778714378214,
             0
          ],
          [
             32.99778714378214,
             "length"
          ],
          [
             -32.99778714378214,
             "length"
          ]
       ]
    }
    
  7. sketch.finish
  8. sheet.flange
    {
       "body_name": "MountingRailM8",
       "rule": "Mounting Rail M8 Rule",
       "sketch": "Flat rail blank",
       "type": "base"
    }
    
  9. sketch.create
    {
       "name": "Repeat round A",
       "plane": {
          "origin": [
             0,
             0,
             1.25
          ],
          "x_dir": [
             1,
             0,
             0
          ],
          "y_dir": [
             0,
             1,
             0
          ]
       }
    }
    
  10. sketch.circle.center
    {
       "center": [
          0,
          12.5
       ],
       "diameter": 12.5
    }
    
  11. sketch.finish
  12. solid.extrude
    {
       "direction": "negative",
       "distance": 2.5,
       "name": "Repeat round A",
       "operation": "cut",
       "targets": [
          "MountingRailM8"
       ]
    }
    
  13. sketch.create
    {
       "name": "Repeat horizontal slot",
       "plane": {
          "origin": [
             0,
             0,
             1.25
          ],
          "x_dir": [
             1,
             0,
             0
          ],
          "y_dir": [
             0,
             1,
             0
          ]
       }
    }
    
  14. sketch.slot.center_to_center
    {
       "p0": [
          0,
          35.7
       ],
       "p1": [
          0,
          39.3
       ],
       "width": 6.4
    }
    
  15. sketch.finish
  16. solid.extrude
    {
       "direction": "negative",
       "distance": 2.5,
       "name": "Repeat horizontal slot",
       "operation": "cut",
       "targets": [
          "MountingRailM8"
       ]
    }
    
  17. sketch.create
    {
       "name": "Repeat round B",
       "plane": {
          "origin": [
             0,
             0,
             1.25
          ],
          "x_dir": [
             1,
             0,
             0
          ],
          "y_dir": [
             0,
             1,
             0
          ]
       }
    }
    
  18. sketch.circle.center
    {
       "center": [
          0,
          62.5
       ],
       "diameter": 12.5
    }
    
  19. sketch.finish
  20. solid.extrude
    {
       "direction": "negative",
       "distance": 2.5,
       "name": "Repeat round B",
       "operation": "cut",
       "targets": [
          "MountingRailM8"
       ]
    }
    
  21. sketch.create
    {
       "name": "Repeat vertical slot",
       "plane": {
          "origin": [
             0,
             0,
             1.25
          ],
          "x_dir": [
             1,
             0,
             0
          ],
          "y_dir": [
             0,
             1,
             0
          ]
       }
    }
    
  22. sketch.slot.center_to_center
    {
       "p0": [
          -3.3,
          87.5
       ],
       "p1": [
          3.3,
          87.5
       ],
       "width": 8.4
    }
    
  23. sketch.finish
  24. solid.extrude
    {
       "direction": "negative",
       "distance": 2.5,
       "name": "Repeat vertical slot",
       "operation": "cut",
       "targets": [
          "MountingRailM8"
       ]
    }
    
  25. solid.pattern.rectangular
    {
       "alignment": "right",
       "count1": "repeat_count",
       "dir1": [
          0,
          1,
          0
       ],
       "features": [
          "Repeat round A",
          "Repeat horizontal slot",
          "Repeat round B",
          "Repeat vertical slot"
       ],
       "reversed": false,
       "spacing1": "repeat_pitch"
    }
    
  26. sheet.fold
    {
       "angle": 90,
       "body": "MountingRailM8",
       "fixed": [
          0,
          125,
          0
       ],
       "flip": false,
       "points": [
          [
             -28.123340357836604,
             0,
             0
          ],
          [
             -28.123340357836604,
             250,
             0
          ]
       ],
       "position": "centerline"
    }
    
  27. sheet.fold
    {
       "angle": 90,
       "body": "MountingRailM8",
       "fixed": [
          0,
          125,
          0
       ],
       "flip": false,
       "points": [
          [
             28.123340357836604,
             0,
             0
          ],
          [
             28.123340357836604,
             250,
             0
          ]
       ],
       "position": "centerline"
    }
    
  28. sheet.fold
    {
       "angle": 90,
       "body": "MountingRailM8",
       "fixed": [
          0,
          125,
          0
       ],
       "flip": false,
       "points": [
          [
             -12.374446785945535,
             0,
             0
          ],
          [
             -12.374446785945535,
             250,
             0
          ]
       ],
       "position": "centerline"
    }
    
  29. sheet.fold
    {
       "angle": 90,
       "body": "MountingRailM8",
       "fixed": [
          0,
          125,
          0
       ],
       "flip": false,
       "points": [
          [
             12.374446785945535,
             0,
             0
          ],
          [
             12.374446785945535,
             250,
             0
          ]
       ],
       "position": "centerline"
    }
    
  30. material.create
    {
       "color": "#9EA6AA",
       "density_g_cm3": 7.85,
       "name": "Galvanized steel"
    }
    
  31. material.assign
    {
       "bodies": [
          "MountingRailM8"
       ],
       "material": "Galvanized steel"
    }
    

Build information

Build scope
main
Build variant
mounting-rail-m8
Physical owner
mounting-rail-m8
Built source
1f2fdb32d67d9af42779500c949f2900ee59c7ae
Forge
v0.23.0 ·
SolidCraft
0.49.0
Runtime
ghcr.io/brainboxemb/cad-solidcraft:v0.3.6