mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
You can now pick the vector style for each drawing style
This commit is contained in:
@@ -156,6 +156,7 @@ class IfcCutter:
|
|||||||
self.template_variables = {}
|
self.template_variables = {}
|
||||||
self.metadata = {}
|
self.metadata = {}
|
||||||
self.data_dir = ''
|
self.data_dir = ''
|
||||||
|
self.vector_style = ''
|
||||||
self.ifc_filenames = []
|
self.ifc_filenames = []
|
||||||
self.ifc_files = {}
|
self.ifc_files = {}
|
||||||
self.resolved_pixels = set()
|
self.resolved_pixels = set()
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
.background { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
.background { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
.hidden { stroke-dasharray: 3, 2; }
|
.hidden { stroke-dasharray: 3, 2; }
|
||||||
|
.solid {}
|
||||||
.leader { marker-end: url(#leader-marker); }
|
.leader { marker-end: url(#leader-marker); }
|
||||||
.stair { marker-start: url(#stair-marker-start); marker-end: url(#stair-marker-end); }
|
.stair { marker-start: url(#stair-marker-start); marker-end: url(#stair-marker-end); }
|
||||||
.break { fill: white; }
|
.break { fill: white; }
|
||||||
.breakline { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
|
.breakline { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
|
||||||
.solid {}
|
|
||||||
.material-blank { fill: white; }
|
.material-blank { fill: white; }
|
||||||
.material-diagonal1 { fill: url(#diagonal1); }
|
.material-diagonal1 { fill: url(#diagonal1); }
|
||||||
.material-diagonal2 { fill: url(#diagonal2); }
|
.material-diagonal2 { fill: url(#diagonal2); }
|
||||||
@@ -21,4 +21,4 @@
|
|||||||
.material-grass { fill: url(#grass); }
|
.material-grass { fill: url(#grass); }
|
||||||
.material-honeycomb { fill: url(#honeycomb); }
|
.material-honeycomb { fill: url(#honeycomb); }
|
||||||
.material-sand { fill: url(#sand); }
|
.material-sand { fill: url(#sand); }
|
||||||
.material-concrete { fill: url(#concrete); }
|
.material-concrete { fill: url(#concrete); stroke-width: 0.5; }
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.cut { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; }
|
||||||
|
.background { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
|
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
|
.hidden { stroke-dasharray: 3, 2; }
|
||||||
|
.solid {}
|
||||||
|
.leader { marker-end: url(#leader-marker); }
|
||||||
|
.stair { marker-start: url(#stair-marker-start); marker-end: url(#stair-marker-end); }
|
||||||
|
.break { fill: white; }
|
||||||
|
.breakline { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
|
||||||
@@ -2066,6 +2066,7 @@ class CutSection(bpy.types.Operator):
|
|||||||
import ifccsv
|
import ifccsv
|
||||||
ifc_cutter.ifc_filenames = [i.name for i in bpy.context.scene.DocProperties.ifc_files]
|
ifc_cutter.ifc_filenames = [i.name for i in bpy.context.scene.DocProperties.ifc_files]
|
||||||
ifc_cutter.data_dir = bpy.context.scene.BIMProperties.data_dir
|
ifc_cutter.data_dir = bpy.context.scene.BIMProperties.data_dir
|
||||||
|
ifc_cutter.vector_style = bpy.context.scene.DocProperties.drawing_styles[camera.data.BIMCameraProperties.active_drawing_style_index].vector_style
|
||||||
ifc_cutter.diagram_name = self.diagram_name
|
ifc_cutter.diagram_name = self.diagram_name
|
||||||
ifc_cutter.background_image = bpy.context.scene.render.filepath
|
ifc_cutter.background_image = bpy.context.scene.render.filepath
|
||||||
if camera.data.BIMCameraProperties.cut_objects == 'CUSTOM':
|
if camera.data.BIMCameraProperties.cut_objects == 'CUSTOM':
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ target_views_enum = []
|
|||||||
persons_enum = []
|
persons_enum = []
|
||||||
organisations_enum = []
|
organisations_enum = []
|
||||||
sheets_enum = []
|
sheets_enum = []
|
||||||
|
vector_styles_enum = []
|
||||||
bcfviewpoints_enum = []
|
bcfviewpoints_enum = []
|
||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
@@ -416,6 +417,16 @@ def getSheets(self, context):
|
|||||||
return sheets_enum
|
return sheets_enum
|
||||||
|
|
||||||
|
|
||||||
|
def getVectorStyles(self, context):
|
||||||
|
global vector_styles_enum
|
||||||
|
if len(vector_styles_enum) < 1:
|
||||||
|
sheets_enum.clear()
|
||||||
|
for filename in Path(os.path.join(context.scene.BIMProperties.data_dir, 'styles')).glob('*.css'):
|
||||||
|
f = str(filename.stem)
|
||||||
|
vector_styles_enum.append((f, f, ''))
|
||||||
|
return vector_styles_enum
|
||||||
|
|
||||||
|
|
||||||
def refreshFontSize(self, context):
|
def refreshFontSize(self, context):
|
||||||
annotation.Annotator.resize_text(context.active_object)
|
annotation.Annotator.resize_text(context.active_object)
|
||||||
|
|
||||||
@@ -443,7 +454,7 @@ class Drawing(PropertyGroup):
|
|||||||
class DrawingStyle(PropertyGroup):
|
class DrawingStyle(PropertyGroup):
|
||||||
name: StringProperty(name='Name')
|
name: StringProperty(name='Name')
|
||||||
raster_style: StringProperty(name='Raster Style')
|
raster_style: StringProperty(name='Raster Style')
|
||||||
vector_style: StringProperty(name='Vector Style')
|
vector_style: EnumProperty(items=getVectorStyles, name='Vector Style')
|
||||||
include_query: StringProperty(name='Include Query')
|
include_query: StringProperty(name='Include Query')
|
||||||
exclude_query: StringProperty(name='Exclude Query')
|
exclude_query: StringProperty(name='Exclude Query')
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class SvgWriter():
|
|||||||
self.height = self.raw_height * self.scale
|
self.height = self.raw_height * self.scale
|
||||||
|
|
||||||
def add_stylesheet(self):
|
def add_stylesheet(self):
|
||||||
with open('{}styles/default.css'.format(self.ifc_cutter.data_dir), 'r') as stylesheet:
|
with open('{}styles/{}.css'.format(self.ifc_cutter.data_dir, self.ifc_cutter.vector_style), 'r') as stylesheet:
|
||||||
self.svg.defs.add(self.svg.style(stylesheet.read()))
|
self.svg.defs.add(self.svg.style(stylesheet.read()))
|
||||||
|
|
||||||
def add_markers(self):
|
def add_markers(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user