Skip to content

Commit

Permalink
Merge pull request #9 from compas-dev/workflow
Browse files Browse the repository at this point in the history
no conda
  • Loading branch information
Licini authored Feb 1, 2024
2 parents 586b6eb + 603cfad commit 2c21b9d
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 44 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ on:

jobs:
Build:
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.9', '3.10', '3.11']

steps:
- uses: compas-dev/compas-actions.build@v3
with:
python: ${{ matrix.python }}
invoke_lint: true
use_conda: true
python: ${{ matrix.python }}
invoke_test: true
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
docs:
runs-on: windows-latest
steps:
- uses: compas-dev/compas-actions.docs@v2
- uses: compas-dev/compas-actions.docs@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
use_conda: true
doc_url: https://compas.dev/compas_ifc

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10']
python: ['3.9', '3.10', '3.11']

steps:
- uses: compas-dev/compas-actions.build@v3
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Updated workflow to not use `conda` anymore.

### Removed


Expand Down
11 changes: 0 additions & 11 deletions environment.yml

This file was deleted.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ifcopenshell
ifcopenshell
lark
3 changes: 1 addition & 2 deletions src/compas_ifc/resources/brep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import numpy as np

from compas.utilities import geometric_key
from compas_occ.brep import OCCBrep
from typing import List

from .primities import point_to_ifc_cartesian_point
Expand All @@ -26,7 +25,7 @@ def calculate_knots_and_multiplicities(knot_sequence):
return knots, multiplicities


def brep_to_ifc_advanced_brep(file: ifcopenshell.file, brep: OCCBrep) -> List[ifcopenshell.entity_instance]:
def brep_to_ifc_advanced_brep(file: ifcopenshell.file, brep) -> List[ifcopenshell.entity_instance]:
brep.fix()
brep.sew()
brep.make_solid()
Expand Down
38 changes: 23 additions & 15 deletions src/compas_ifc/resources/geometricmodel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import List

from compas_occ.brep import OCCBrep

# from compas.geometry import Polyline
from compas.geometry import Box
from compas.geometry import Line
Expand All @@ -14,15 +12,15 @@
from ifcopenshell import geom


def IfcAdvancedBrep_to_brep(advanced_brep) -> OCCBrep:
def IfcAdvancedBrep_to_brep(advanced_brep):
"""
Convert an IFC AdvancedBrep [advancedbrep]_ to a COMPAS brep.
"""
pass


def IfcAdvancedBrepWithVoids_to_brep(advanced_brep_with_voids) -> OCCBrep:
def IfcAdvancedBrepWithVoids_to_brep(advanced_brep_with_voids):
"""
Convert an IFC AdvancedBrepWithVoids [advancedbrepwithvoids]_ to a COMPAS brep.
Expand All @@ -38,19 +36,21 @@ def IfcBlock_to_box(block) -> Box:
pass


def IfcBooleanClippingResult_to_brep(boolean_clipping_result) -> OCCBrep:
def IfcBooleanClippingResult_to_brep(boolean_clipping_result):
"""
Convert an IFC BooleanClippingResult [booleanclippingresult]_ to a COMPAS brep.
"""
return IfcBooleanResult_to_brep(boolean_clipping_result)


def IfcBooleanResult_to_brep(boolean_result) -> OCCBrep:
def IfcBooleanResult_to_brep(boolean_result):
"""
Convert an IFC BooleanResult [booleanresult]_ to a COMPAS brep.
"""
from compas_occ.brep import OCCBrep

br = boolean_result

# First Operand
Expand Down Expand Up @@ -113,7 +113,7 @@ def IfcBoundingBox_to_box(bounding_box) -> Box:
return box


def IfcBoxedHalfSpace(boxed_half_space) -> OCCBrep:
def IfcBoxedHalfSpace(boxed_half_space):
bhs = boxed_half_space
print(bhs.BaseSurface)
print(bhs.Enclosure)
Expand All @@ -124,7 +124,9 @@ def IfcCartesianPointList(cartesian_point_list) -> List[Point]:
return [Point(*p) for p in cartesian_point_list.CoordList]


def IfcExtrudedAreaSolid_to_brep(extruded_area_solid) -> OCCBrep:
def IfcExtrudedAreaSolid_to_brep(extruded_area_solid):
from compas_occ.brep import OCCBrep

eas = extruded_area_solid
profile = IfcProfileDef_to_curve(eas.SweptArea)

Expand Down Expand Up @@ -154,16 +156,16 @@ def _extrude(profile, eas):
return _extrude(profile, eas)


def IfcFacetedBrep_to_brep(faceted_brep) -> OCCBrep:
def IfcFacetedBrep_to_brep(faceted_brep):
pass


def IfcFacetedBrepWithVoids_to_brep(faceted_brep_with_voids) -> OCCBrep:
def IfcFacetedBrepWithVoids_to_brep(faceted_brep_with_voids):
# fbwv = faceted_brep_with_voids
pass


def IfcIndexedPolygonalFaceSet_to_brep() -> OCCBrep:
def IfcIndexedPolygonalFaceSet_to_brep():
pass


Expand All @@ -174,7 +176,9 @@ def IfcPolygonalBoundedHalfSpace_to_brep(polygonal_bounded_half_space):
print(pbhs.BaseSurface)


def IfcPolygonalFaceSet_to_brep(polygonal_face_set) -> OCCBrep:
def IfcPolygonalFaceSet_to_brep(polygonal_face_set):
from compas_occ.brep import OCCBrep

pfs = polygonal_face_set

xyz = pfs.Coordinates.CoordList
Expand All @@ -190,7 +194,7 @@ def IfcPolygonalFaceSet_to_brep(polygonal_face_set) -> OCCBrep:
return brep


def IfcTessellatedFaceSet_to_brep(tessellated_face_set) -> OCCBrep:
def IfcTessellatedFaceSet_to_brep(tessellated_face_set):
tfs = tessellated_face_set

if tfs.is_a("IfcTriangulatedFaceSet"):
Expand All @@ -202,7 +206,9 @@ def IfcTessellatedFaceSet_to_brep(tessellated_face_set) -> OCCBrep:
raise NotImplementedError(tfs.is_a())


def IfcTriangulatedFaceSet_to_brep(triangulated_face_set) -> OCCBrep:
def IfcTriangulatedFaceSet_to_brep(triangulated_face_set):
from compas_occ.brep import OCCBrep

tfs = triangulated_face_set

xyz = tfs.Coordinates.CoordList
Expand All @@ -218,7 +224,9 @@ def IfcTriangulatedFaceSet_to_brep(triangulated_face_set) -> OCCBrep:
return brep


def IfcShape_to_brep(ifc_shape) -> OCCBrep:
def IfcShape_to_brep(ifc_shape):
from compas_occ.brep import OCCBrep

settings = geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
shape = geom.create_shape(settings, ifc_shape)
Expand Down
8 changes: 5 additions & 3 deletions src/compas_ifc/resources/geometry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# from compas_occ.geometry import OCCNurbsCurve
from compas_occ.brep import OCCBrepFace

from compas.geometry import Frame
from compas.geometry import Line
from compas.geometry import Plane
Expand Down Expand Up @@ -118,7 +116,9 @@ def IfcCartesianTransformationOperator3D_to_frame(operator) -> Frame:
return Frame(point, xaxis, yaxis)


def IfcProfileDef_to_curve(profile_def) -> OCCBrepFace:
def IfcProfileDef_to_curve(profile_def):
from compas_occ.brep import OCCBrepFace

pd = profile_def

if pd.is_a("IfcParameterizedProfileDef"):
Expand Down Expand Up @@ -149,6 +149,8 @@ def IfcProfileDef_to_curve(profile_def) -> OCCBrepFace:


def IfcCurve_to_face(curve):
from compas_occ.brep import OCCBrepFace

if curve.is_a("IfcIndexedPolyCurve"):
points = [(x, y, 0) for x, y in curve.Points[0]]
return OCCBrepFace.from_polygon(points)
Expand Down
4 changes: 1 addition & 3 deletions src/compas_ifc/resources/primities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import ifcopenshell

from OCC.Core.gp import gp_Pln

from compas.geometry import Frame
from compas.geometry import Point
from .shapes import create_IfcAxis2Placement3D
Expand All @@ -15,7 +13,7 @@ def point_to_ifc_cartesian_point(file: ifcopenshell.file, point: Point) -> ifcop
return file.create_entity("IFCCARTESIANPOINT", (*point,))


def occ_plane_to_frame(occ_plane: gp_Pln) -> Frame:
def occ_plane_to_frame(occ_plane) -> Frame:
"""
Convert an OCC plane to a COMPAS frame.
"""
Expand Down
3 changes: 2 additions & 1 deletion src/compas_ifc/resources/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from compas.geometry import Cone
from compas.geometry import Cylinder
from compas.geometry import Sphere
from compas_occ.brep import OCCBrep

from .brep import brep_to_ifc_advanced_brep
from .mesh import mesh_to_IfcPolygonalFaceSet
Expand All @@ -16,6 +15,8 @@


def write_body_representation(file, body, ifc_entity, context):
from compas_occ.brep import OCCBrep

def _body_to_shape(body):
if isinstance(body, Box):
shape = box_to_IfcBlock(file, body)
Expand Down

0 comments on commit 2c21b9d

Please sign in to comment.